### 2023-01-21更新

------
#### SuperDesign    V2.0.2301.2101
- *.[新增]新增API编辑器,自动保存和快速插入修改参数。
- *.[改进]使用新款高亮编辑器。
This commit is contained in:
鑫Intel 2023-01-21 23:27:44 +08:00
parent dca2bd3d1c
commit c7b33920bd
49 changed files with 4529 additions and 1658 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -213,6 +213,12 @@
</summary> </summary>
</member> </member>
<member name="M:ryCommonDb.SQLiteDataProvider.GetLastError">
<summary>
获取最后一次错误信息
</summary>
<returns></returns>
</member>
<member name="F:ryCommonDb.SQLiteDataProvider.myDb"> <member name="F:ryCommonDb.SQLiteDataProvider.myDb">
<summary> <summary>
@ -358,6 +364,30 @@
<param name="Parameter"></param> <param name="Parameter"></param>
<returns></returns> <returns></returns>
</member> </member>
<member name="M:ryCommonDb.SQLiteDataProvider.ExecuteNonQuery(ryCommonDb.RyQuickSQL,System.String,System.Boolean)">
<summary>
执行SQL语句
</summary>
<param name="mySQL"></param>
<param name="wheresql">只针对IsAdd为false才生效where 以后的sql语句</param>
<param name="IsAdd">是新增还是更新</param>
<returns></returns>
</member>
<member name="M:ryCommonDb.SQLiteDataProvider.Insert(ryCommonDb.RyQuickSQL)">
<summary>
插入数据库
</summary>
<param name="mySQL"></param>
<returns></returns>
</member>
<member name="M:ryCommonDb.SQLiteDataProvider.Update(ryCommonDb.RyQuickSQL,System.String)">
<summary>
更新数据库
</summary>
<param name="mySQL"></param>
<param name="wheresql">where 以后的sql语句</param>
<returns></returns>
</member>
<member name="M:ryCommonDb.SQLiteDataProvider.ExecuteNonQuery(System.String,ryCommonDb.RyQuickSQL)"> <member name="M:ryCommonDb.SQLiteDataProvider.ExecuteNonQuery(System.String,ryCommonDb.RyQuickSQL)">
<summary> <summary>

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,10 @@
### 2021-09-03更新 ### 2023-01-21更新
------
#### SuperDesign V2.0.2301.2101
- *.[新增]新增API编辑器,自动保存和快速插入修改参数。
- *.[改进]使用新款高亮编辑器。
### 2021-09-03更新
------ ------
#### SuperDesign V2.0.2109.0301 #### SuperDesign V2.0.2109.0301
- *.[改进]全新网页抓取工具,对历史记录支持编辑和收藏。 - *.[改进]全新网页抓取工具,对历史记录支持编辑和收藏。

View File

@ -1,42 +0,0 @@
namespace ryProcessManager.hezuo
{
partial class ContextMenuStripHighlightText
{
/// <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
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.SuspendLayout();
//
// ContextMenuStripRichText
//
this.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStripRichText_Opening);
this.ResumeLayout(false);
}
#endregion
}
}

View File

@ -1,137 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows.Forms;
namespace ryProcessManager.hezuo
{
public partial class ContextMenuStripHighlightText : ContextMenuStrip
{
public ContextMenuStripHighlightText()
{
InitializeComponent();
AddMenu("撤销", "undo").Click += Undo_Click;
AddMenu("重做", "redo").Click += Redo_Click;
AddSeparatorMenu();
AddMenu("剪切", "cut").Click += Cut_Click;
AddMenu("复制", "copy").Click += Copy_Click;
AddMenu("粘贴", "paste").Click += Paste_Click;
AddMenu("删除", "del").Click += Del_Click;
AddMenu("全选", "selectall").Click += SelectAll_Click;
AddMenu("查找", "find").Click += Find_Click;
}
private void Find_Click(object sender, EventArgs e)
{
if (!(base.SourceControl is FastColoredTextBoxNS.FastColoredTextBox)) { return; }
var rich_txt = (FastColoredTextBoxNS.FastColoredTextBox)base.SourceControl;
rich_txt.ShowFindDialog();
}
private void SelectAll_Click(object sender, EventArgs e)
{
if (!(base.SourceControl is FastColoredTextBoxNS.FastColoredTextBox)) { return; }
var rich_txt = (FastColoredTextBoxNS.FastColoredTextBox)base.SourceControl;
rich_txt.SelectAll();
//Thread th = new Thread(sendkey);
//th.Start();
//void sendkey()
//{
// Thread.Sleep(100);
// this.Invoke(new Action(() =>
// {
// SendKeys.SendWait("^a");
// }));
//}
}
private void Undo_Click(object sender, EventArgs e)
{
if(!(base.SourceControl is FastColoredTextBoxNS.FastColoredTextBox)) { return; }
var rich_txt = (FastColoredTextBoxNS.FastColoredTextBox)base.SourceControl;
rich_txt.Undo();
}
private void Redo_Click(object sender, EventArgs e)
{
if (!(base.SourceControl is FastColoredTextBoxNS.FastColoredTextBox)) { return; }
var rich_txt = (FastColoredTextBoxNS.FastColoredTextBox)base.SourceControl;
rich_txt.Redo();
}
private void Cut_Click(object sender, EventArgs e)
{
if (!(base.SourceControl is FastColoredTextBoxNS.FastColoredTextBox)) { return; }
var rich_txt = (FastColoredTextBoxNS.FastColoredTextBox)base.SourceControl;
rich_txt.Cut();
}
private void Copy_Click(object sender, EventArgs e)
{
if (!(base.SourceControl is FastColoredTextBoxNS.FastColoredTextBox)) { return; }
var rich_txt = (FastColoredTextBoxNS.FastColoredTextBox)base.SourceControl;
var ss = rich_txt.SelectedText;
rich_txt.Copy();
}
private void Paste_Click(object sender, EventArgs e)
{
if (!(base.SourceControl is FastColoredTextBoxNS.FastColoredTextBox)) { return; }
var rich_txt = (FastColoredTextBoxNS.FastColoredTextBox)base.SourceControl;
rich_txt.Paste();
}
private void Del_Click(object sender, EventArgs e)
{
if (!(base.SourceControl is FastColoredTextBoxNS.FastColoredTextBox)) { return; }
var rich_txt = (FastColoredTextBoxNS.FastColoredTextBox)base.SourceControl;
rich_txt.SelectedText="";
}
public ToolStripSeparator AddSeparatorMenu()
{
ToolStripSeparator item = new ToolStripSeparator();
base.Items.Add(item);
return item;
}
public ToolStripMenuItem AddMenu(string name, string tag)
{
ToolStripMenuItem item = new ToolStripMenuItem(name)
{
Tag = tag
};
base.Items.Add(item);
return item;
}
private void ContextMenuStripRichText_Opening(object sender, CancelEventArgs e)
{
if (!(base.SourceControl is FastColoredTextBoxNS.FastColoredTextBox)) { return; }
var rich_txt = (FastColoredTextBoxNS.FastColoredTextBox)base.SourceControl;
for (int i = 0; i < base.Items.Count; i++)
{
var item = base.Items[i];
if (item.Tag == null) { continue; }
switch(item.Tag.ToString())
{
case "undo":
item.Enabled = rich_txt.UndoEnabled && !rich_txt.ReadOnly;
break;
case "redo":
item.Enabled = rich_txt.RedoEnabled && !rich_txt.ReadOnly;
break;
case "cut":
item.Enabled = (rich_txt.SelectedText != "" && !rich_txt.ReadOnly) ? true : false;
break;
case "copy":
item.Enabled = rich_txt.SelectedText != "" ? true : false;
break;
case "paste":
item.Enabled = !rich_txt.ReadOnly;
break;
case "del":
item.Enabled =(rich_txt.SelectedText != "" && !rich_txt.ReadOnly) ? true : false;
break;
case "selectall":
item.Enabled = rich_txt.SelectedText != rich_txt.Text ? true : false;
break;
}
}
}
}
}

View File

@ -1,123 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</metadata>
</root>

View File

@ -1,33 +1,33 @@
namespace .Controls namespace .Controls
{ {
partial class FrmText partial class FrmText
{ {
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
/// </summary> /// </summary>
private System.ComponentModel.IContainer components = null; private System.ComponentModel.IContainer components = null;
/// <summary> /// <summary>
/// Clean up any resources being used. /// Clean up any resources being used.
/// </summary> /// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) protected override void Dispose(bool disposing)
{ {
if (disposing && (components != null)) if (disposing && (components != null))
{ {
components.Dispose(); components.Dispose();
} }
base.Dispose(disposing); base.Dispose(disposing);
} }
#region Windows Form Designer generated code #region Windows Form Designer generated code
/// <summary> /// <summary>
/// Required method for Designer support - do not modify /// Required method for Designer support - do not modify
/// the contents of this method with the code editor. /// the contents of this method with the code editor.
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.panelEx1 = new ryControls.PanelEx(); this.panelEx1 = new ryControls.PanelEx();
this.richTextBox1 = new System.Windows.Forms.RichTextBox(); this.richTextBox1 = new System.Windows.Forms.RichTextBox();
this.contextMenuStripRichText1 = new ryProcessManager.hezuo.ContextMenuStripRichText(); this.contextMenuStripRichText1 = new ryProcessManager.hezuo.ContextMenuStripRichText();
@ -92,13 +92,13 @@
this.panelEx1.ResumeLayout(false); this.panelEx1.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
#endregion #endregion
private ryControls.PanelEx panelEx1; private ryControls.PanelEx panelEx1;
private ryControls.ButtonEx BtnSave; private ryControls.ButtonEx BtnSave;
private ryProcessManager.hezuo.ContextMenuStripRichText contextMenuStripRichText1; private ryProcessManager.hezuo.ContextMenuStripRichText contextMenuStripRichText1;
public System.Windows.Forms.RichTextBox richTextBox1; public System.Windows.Forms.RichTextBox richTextBox1;
} }
} }

View File

@ -31,12 +31,12 @@ namespace ryPaiban.Model
{ {
if (_SourceContent != null) if (_SourceContent != null)
{ {
_SourceContent.FormClosing -= _SourceContent_FormClosing; _SourceContent.FormClosing -= SourceContent_FormClosing;
} }
_SourceContent = value; _SourceContent = value;
if (value != null) if (value != null)
{ {
_SourceContent.FormClosing += _SourceContent_FormClosing; _SourceContent.FormClosing += SourceContent_FormClosing;
_SourceContent.TabPageContextMenuStrip = this; _SourceContent.TabPageContextMenuStrip = this;
} }
} }
@ -44,7 +44,7 @@ namespace ryPaiban.Model
} }
private void _SourceContent_FormClosing(object sender, FormClosingEventArgs e) private void SourceContent_FormClosing(object sender, FormClosingEventArgs e)
{ {
if (Itrycn_Db.IsCloseConfirm) if (Itrycn_Db.IsCloseConfirm)
{ {

View File

@ -1,280 +1,283 @@
using DotNet4.Utilities; using DotNet4.Utilities;
using HtmlAgilityPack; using HtmlAgilityPack;
using Microsoft.Win32; using Microsoft.Win32;
using ryCommon; using ryCommon;
using ryCommonDb; using ryCommonDb;
using Sheng.Winform.Controls.PopupControl; using Sheng.Winform.Controls.PopupControl;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
using System.Xml; using System.Xml;
using WeifenLuo.WinFormsUI.Docking; using WeifenLuo.WinFormsUI.Docking;
using .Manager; using .Manager;
using .Tools; using .Tools;
namespace namespace
{ {
public partial class Form1 : Form public partial class Form1 : Form
{ {
string _ProjectPath = ""; public Form1(string ProjectPath,string mode)
public Form1(string ProjectPath,string mode) {
{ InitializeComponent();
_ProjectPath = ProjectPath; if(ProjectPath!="")
InitializeComponent(); {
if(ProjectPath!="") if (mode == "get")
{ {
if (mode == "get") FrmProject frm = new FrmProject(ProjectPath);
{ frm.Show(dockPanel1);
FrmProject frm = new FrmProject(ProjectPath); }
frm.Show(dockPanel1); else if (mode == "open")
} {
else if (mode == "open") FrmPathInfo frm = new FrmPathInfo(ProjectPath);
{ frm.Show(dockPanel1);
FrmPathInfo frm = new FrmPathInfo(ProjectPath); }
frm.Show(dockPanel1); }
} Manager.Itrycn_Db.CreateSysTable();
} Manager.Itrycn_Db.CreateUserTable();
Manager.Itrycn_Db.CreateSysTable(); LoadBaseTools();
Manager.Itrycn_Db.CreateUserTable();
LoadBaseTools();
}
public void HideDownList()
{
table1.Visible = false;
}
private void LoadBaseTools()
{
DataProvider mydb = new DataProvider();
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
DataSet ds = db.ReadData("select * from Starts order by ClickCount desc,editTime desc");
if(mydb.HaveData(ds))
{
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
DataRow row = ds.Tables[0].Rows[i];
Type type = Type.GetType(row["Addr"].ToString());
if (type == null) { continue; }
ShowForm(type);
}
}
else
{
ShowForm(typeof(FrmWebGet));
ShowForm(typeof(FrmXpath));
ShowForm(typeof(FrmRegex));
ShowForm(typeof(FrmEncode));
}
}
db.Free();
//ShowForm(Type.GetType("开发辅助工具.Tools.FrmWebGet"));
//ShowForm(typeof(FrmToolsBox));
//FrmProject frm = new FrmProject(ProjectPath);
//frm.Show(dockPanel1);
}
private void ShowForm(Type type)
{
DockContent frm = (DockContent)Activator.CreateInstance(type);
frm.Click += Frm_Click;
frm.Show(dockPanel1);
}
private void Frm_Click(object sender, EventArgs e)
{
HideDownList();
}
private void Form1_Load(object sender, EventArgs e)
{
Text = "开发辅助工具 V"+ryCommon.RySoft.VersionStr;
bool test_mode = false;
if (System.IO.File.Exists(Application.StartupPath + "\\测试.txt")){test_mode = true;}
BtnTools.Visible = test_mode;
BtnSetting.Visible = test_mode;
BtnCreateProject.Visible = test_mode;
DataProvider mydb = new DataProvider();
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
RyQuickSQL mySQL = new RyQuickSQL("Urls");
mySQL.AddField("editTime",DateTime.Now.AddDays(-10));
db.ExecuteNonQuery("DELETE FROM Urls WHERE id IN (SELECT id FROM Urls ORDER BY ClickCount desc,editTime desc LIMIT 1000,50) and editTime<=@editTime and IsFav<>1", mySQL);
}
db.Free();
}
private void BtnTools_Click(object sender, EventArgs e)
{
FrmToolsSearch frm = new FrmToolsSearch();
frm.ShowDialog();
}
private void RySearch1_OnTextChanged(object sender, EventArgs e)
{
string sql_where = "";
if (rySearch1.Text != ""){ sql_where = " where (Name like @SearchText or Des like @SearchText or Keys like @SearchText or PY like @SearchText)"; }
#region
tableModel1.Rows.Clear();
tableModel1.Selections.Clear();
DataProvider mydb = new DataProvider();
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.Sys_SQLConn) == 1)
{
db.AddParameter("SearchText", "%" + rySearch1.Text + "%");
DataSet ds = db.ReadData("select * from Tools"+ sql_where+ " order by sort desc, addTime desc", db.GetParameter());
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
DataRow row = ds.Tables[0].Rows[i];
XPTable.Models.Row itemList = new XPTable.Models.Row()
{
Tag = row["Addr"].ToString()
};
//需要修改此处
itemList.Cells.Add(new XPTable.Models.Cell(row["Name"].ToString()));//示例
var cell = new XPTable.Models.Cell(row["Des"].ToString());
cell.ForeColor = Color.Gray;
itemList.Cells.Add(cell);
tableModel1.Rows.Add(itemList);
}
db.Free();
textColumn4.Text = "工具名称("+ tableModel1.Rows.Count+ ")";
table1.Visible = tableModel1.Rows.Count!=0;
}
#endregion
}
private void RySearch1_KeyDown(object sender, KeyEventArgs e)
{
if(e.KeyCode==Keys.Down)
{
if (table1.Visible)
{
table1.TableModel.Selections.Clear();
table1.TableModel.Selections.AddCells(0, 0, 0, columnModel1.Columns.Count - 1);
table1.Focus();
}
}
}
private void Table1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Up)
{
if (table1.SelectedItems.Length>0 && table1.SelectedItems[0].Index==0)
{
table1.TableModel.Selections.Clear();
rySearch1.Select();
}
}
else if(e.KeyCode==Keys.Enter)
{
ClickItem();
}
}
private void DockPanel1_Enter(object sender, EventArgs e)
{
table1.Visible = false;
}
private void Panel1_Click(object sender, EventArgs e)
{
table1.Visible = false;
}
private void ClickItem()
{
if (table1.SelectedItems.Length > 0)
{
table1.Visible = false;
Application.DoEvents();
string addr = table1.SelectedItems[0].Tag.ToString();
Type type = Type.GetType("开发辅助工具." + addr);
if (type == null)
{
MessageBox.Show("无法找到工具", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
ShowForm(type);
}
}
}
private void Table1_Click(object sender, EventArgs e)
{
ClickItem();
}
private const int WM_COPYDATA = 0x004A;
protected override void WndProc(ref Message m)
{
//Console.WriteLine(m.Msg);
const int WM_SYSCOMMAND = 0x0112;
const int SC_CLOSE = 0xF060;
#region
if (m.Msg == WM_SYSCOMMAND && (int)m.WParam == SC_CLOSE)
{
//捕捉关闭窗体消息
//用户点击关闭窗体控制按钮 注释为最小化窗体
//this.WindowState = FormWindowState.Minimized;
if (Itrycn_Db.IsCloseConfirm)
{
switch (MessageBox.Show("是否确定要关闭所有窗口?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question))
{
case DialogResult.Cancel:
RyForm.SetActiveWindow(Handle);
return;
case DialogResult.OK:
Itrycn_Db.IsCloseConfirm = false;
break;
}
}
}
#endregion
base.WndProc(ref m);
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
Itrycn_Db.IsCloseConfirm = false;
}
private void RySearch1_Leave(object sender, EventArgs e)
{
if (!table1.Focused)
{
table1.Visible = false;
}
}
private void Table1_Leave(object sender, EventArgs e)
{
if (!rySearch1.Focused)
{
table1.Visible = false;
}
}
private void BtnSetting_Click(object sender, EventArgs e)
{
FrmSetting frm = new FrmSetting();
frm.Icon = Icon;
frm.ShowDialog();
}
private void BtnCreateProject_Click(object sender, EventArgs e)
{
FrmCreateProject frm = new FrmCreateProject();
frm.Icon = Icon;
frm.StartPosition = FormStartPosition.CenterParent;
frm.ShowDialog();
} }
} public void HideDownList()
{
} table1.Visible = false;
}
private void LoadBaseTools()
{
DataProvider mydb = new DataProvider();
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
DataSet ds = db.ReadData("select * from Starts order by ClickCount desc,editTime desc");
if(mydb.HaveData(ds))
{
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
DataRow row = ds.Tables[0].Rows[i];
Type type = Type.GetType(row["Addr"].ToString());
if (type == null) { continue; }
ShowForm(type);
}
}
else
{
ShowForm(typeof(FrmWebGet));
ShowForm(typeof(FrmXpath));
ShowForm(typeof(FrmRegex));
ShowForm(typeof(FrmEncode));
}
}
db.Free();
//ShowForm(Type.GetType("开发辅助工具.Tools.FrmWebGet"));
//ShowForm(typeof(FrmToolsBox));
//FrmProject frm = new FrmProject(ProjectPath);
//frm.Show(dockPanel1);
}
private void ShowForm(Type type)
{
DockContent frm = (DockContent)Activator.CreateInstance(type);
frm.Click += Frm_Click;
frm.Show(dockPanel1);
}
private void Frm_Click(object sender, EventArgs e)
{
HideDownList();
}
private void Form1_Load(object sender, EventArgs e)
{
Text = "开发辅助工具 V"+ryCommon.RySoft.VersionStr;
bool test_mode = false;
if (System.IO.File.Exists(Application.StartupPath + "\\测试.txt")){test_mode = true;}
BtnTools.Visible = test_mode;
BtnSetting.Visible = test_mode;
BtnCreateProject.Visible = test_mode;
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
RyQuickSQL mySQL = new RyQuickSQL("Urls");
mySQL.AddField("editTime",DateTime.Now.AddDays(-10));
db.ExecuteNonQuery("DELETE FROM Urls WHERE id IN (SELECT id FROM Urls ORDER BY ClickCount desc,editTime desc LIMIT 1000,50) and editTime<=@editTime and IsFav<>1", mySQL);
}
db.Free();
}
private void BtnTools_Click(object sender, EventArgs e)
{
FrmToolsSearch frm = new FrmToolsSearch();
frm.ShowDialog();
}
private void RySearch1_OnTextChanged(object sender, EventArgs e)
{
string sql_where = "";
if (rySearch1.Text != ""){ sql_where = " where (Name like @SearchText or Des like @SearchText or Keys like @SearchText or PY like @SearchText)"; }
#region
tableModel1.Rows.Clear();
tableModel1.Selections.Clear();
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.Sys_SQLConn) == 1)
{
db.AddParameter("SearchText", "%" + rySearch1.Text + "%");
DataSet ds = db.ReadData("select * from Tools"+ sql_where+ " order by sort desc, addTime desc", db.GetParameter());
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
DataRow row = ds.Tables[0].Rows[i];
XPTable.Models.Row itemList = new XPTable.Models.Row()
{
Tag = row["Addr"].ToString()
};
//需要修改此处
itemList.Cells.Add(new XPTable.Models.Cell(row["Name"].ToString()));//示例
var cell = new XPTable.Models.Cell(row["Des"].ToString())
{
ForeColor = Color.Gray
};
itemList.Cells.Add(cell);
tableModel1.Rows.Add(itemList);
}
db.Free();
textColumn4.Text = "工具名称("+ tableModel1.Rows.Count+ ")";
table1.Visible = tableModel1.Rows.Count!=0;
}
#endregion
}
private void RySearch1_KeyDown(object sender, KeyEventArgs e)
{
if(e.KeyCode==Keys.Down)
{
if (table1.Visible)
{
table1.TableModel.Selections.Clear();
table1.TableModel.Selections.AddCells(0, 0, 0, columnModel1.Columns.Count - 1);
table1.Focus();
}
}
}
private void Table1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Up)
{
if (table1.SelectedItems.Length>0 && table1.SelectedItems[0].Index==0)
{
table1.TableModel.Selections.Clear();
rySearch1.Select();
}
}
else if(e.KeyCode==Keys.Enter)
{
ClickItem();
}
}
private void DockPanel1_Enter(object sender, EventArgs e)
{
table1.Visible = false;
}
private void Panel1_Click(object sender, EventArgs e)
{
table1.Visible = false;
}
private void ClickItem()
{
if (table1.SelectedItems.Length > 0)
{
table1.Visible = false;
Application.DoEvents();
string addr = table1.SelectedItems[0].Tag.ToString();
Type type = Type.GetType("开发辅助工具." + addr);
if (type == null)
{
MessageBox.Show("无法找到工具", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
ShowForm(type);
}
}
}
private void Table1_Click(object sender, EventArgs e)
{
ClickItem();
}
protected override void WndProc(ref Message m)
{
//Console.WriteLine(m.Msg);
const int WM_SYSCOMMAND = 0x0112;
const int SC_CLOSE = 0xF060;
#region
if (m.Msg == WM_SYSCOMMAND && (int)m.WParam == SC_CLOSE)
{
//捕捉关闭窗体消息
//用户点击关闭窗体控制按钮 注释为最小化窗体
//this.WindowState = FormWindowState.Minimized;
if (Itrycn_Db.IsCloseConfirm)
{
switch (MessageBox.Show("是否确定要关闭所有窗口?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question))
{
case DialogResult.Cancel:
RyForm.SetActiveWindow(Handle);
return;
case DialogResult.OK:
Itrycn_Db.IsCloseConfirm = false;
break;
}
}
}
#endregion
base.WndProc(ref m);
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
Itrycn_Db.IsCloseConfirm = false;
}
private void RySearch1_Leave(object sender, EventArgs e)
{
if (!table1.Focused)
{
table1.Visible = false;
}
}
private void Table1_Leave(object sender, EventArgs e)
{
if (!rySearch1.Focused)
{
table1.Visible = false;
}
}
private void BtnSetting_Click(object sender, EventArgs e)
{
FrmSetting frm = new FrmSetting
{
Icon = Icon
};
frm.ShowDialog();
frm.Dispose();
}
private void BtnCreateProject_Click(object sender, EventArgs e)
{
FrmCreateProject frm = new FrmCreateProject
{
Icon = Icon,
StartPosition = FormStartPosition.CenterParent
};
frm.ShowDialog();
frm.Dispose();
}
}
}

View File

@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>5, 32</value>
</metadata> </metadata>
<metadata name="vS2015LightTheme1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="vS2015LightTheme1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>130, 32</value> <value>130, 32</value>

View File

@ -138,7 +138,6 @@ namespace 开发辅助工具.Tools
{ {
return; return;
} }
DataProvider mydb = new DataProvider();
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType); IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.Sys_SQLConn) == 1) if (db.ConnDb(Itrycn_Db.Sys_SQLConn) == 1)
{ {

View File

@ -45,7 +45,6 @@ namespace 开发辅助工具.Manager
} }
public static void CreateSysTable() public static void CreateSysTable()
{ {
DataProvider mydb = new DataProvider();
IDbInterface db = CreateDataProvider(dataType); IDbInterface db = CreateDataProvider(dataType);
if (db.ConnDb(Sys_SQLConn) == 1) if (db.ConnDb(Sys_SQLConn) == 1)
{ {
@ -65,7 +64,6 @@ namespace 开发辅助工具.Manager
} }
public static void CreateUserTable() public static void CreateUserTable()
{ {
DataProvider mydb = new DataProvider();
IDbInterface db = CreateDataProvider(dataType); IDbInterface db = CreateDataProvider(dataType);
if (db.ConnDb(User_SQLConn) == 1) if (db.ConnDb(User_SQLConn) == 1)
{ {
@ -109,12 +107,24 @@ namespace 开发辅助工具.Manager
#endregion #endregion
#region #region
mySQL.Clear(); mySQL.Clear();
mySQL.TableName = "Settings"; ; mySQL.TableName = "Settings";
mySQL.AddField("Name", ""); mySQL.AddField("Name", "");
mySQL.AddField("Value", "");//值 mySQL.AddField("Value", "");//值
mySQL.AddField("addTime", DateTime.Now); mySQL.AddField("addTime", DateTime.Now);
db.CreateDb(mySQL); db.CreateDb(mySQL);
#endregion #endregion
#region API表
mySQL.Clear();
mySQL.TableName = "api";
mySQL.AddField("Name", "");
mySQL.AddField("Url", "");
mySQL.AddField("APIName", "");
mySQL.AddField("Postdata", "");
mySQL.AddField("ClickCount", 0);//点击次数
mySQL.AddField("editTime", DateTime.Now);
mySQL.AddField("addTime", DateTime.Now);
db.CreateDb(mySQL);
#endregion
} }
} }
} }

View File

@ -47,7 +47,7 @@ namespace 开发辅助工具.Manager
{ {
try try
{ {
var jo= (JObject)JsonConvert.DeserializeObject(str); var jo= JsonConvert.DeserializeObject(str);
return true; return true;
} }
catch(Exception ex) catch(Exception ex)

View File

@ -188,12 +188,13 @@ namespace 开发辅助工具.Manager
if (RyFiles.CopyFile(sourch_folder + "\\x64\\*", _path + "\\x64\\") != 0) if (RyFiles.CopyFile(sourch_folder + "\\x64\\*", _path + "\\x64\\") != 0)
{ _error_str += sourch_folder + "\\x64\\*\r\n"; error++; } { _error_str += sourch_folder + "\\x64\\*\r\n"; error++; }
} }
if (RyFiles.CopyFile(dllpath, files[i]) != 0) if (dllpath!= files[i] && RyFiles.CopyFile(dllpath, files[i]) != 0)
{ _error_str += files[i]+ "\r\n"; error++; } { _error_str += files[i]+ "\r\n"; error++; }
var dll_xml_path = System.IO.Path.GetDirectoryName(dllpath) +"\\"+ System.IO.Path.GetFileNameWithoutExtension(dllpath) + ".xml"; var dll_xml_path = System.IO.Path.GetDirectoryName(dllpath) +"\\"+ System.IO.Path.GetFileNameWithoutExtension(dllpath) + ".xml";
if (System.IO.File.Exists(dll_xml_path)) if (System.IO.File.Exists(dll_xml_path))
{ {
if (RyFiles.CopyFile(dll_xml_path, System.IO.Path.GetDirectoryName(files[i]) + "\\" + System.IO.Path.GetFileNameWithoutExtension(files[i]) + ".xml") != 0) var to_xml_path = System.IO.Path.GetDirectoryName(files[i]) + "\\" + System.IO.Path.GetFileNameWithoutExtension(files[i]) + ".xml";
if (dll_xml_path.ToLower()!=to_xml_path.ToLower() && RyFiles.CopyFile(dll_xml_path, to_xml_path) != 0)
{ _error_str += files[i] + "\r\n"; error++; } { _error_str += files[i] + "\r\n"; error++; }
} }
} }

View File

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: : // 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.2109.0301")] [assembly: AssemblyVersion("2.0.2301.2101")]
[assembly: AssemblyFileVersion("2.0.2109.0301")] [assembly: AssemblyFileVersion("2.0.2301.2101")]

View File

@ -59,5 +59,55 @@ namespace SuperDesign.Properties {
resourceCulture = value; resourceCulture = value;
} }
} }
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap Clock {
get {
object obj = ResourceManager.GetObject("Clock", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap DeleteHS {
get {
object obj = ResourceManager.GetObject("DeleteHS", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap GoToNextMessage {
get {
object obj = ResourceManager.GetObject("GoToNextMessage", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap GoToPreviousMessage {
get {
object obj = ResourceManager.GetObject("GoToPreviousMessage", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// 查找 System.Drawing.Bitmap 类型的本地化资源。
/// </summary>
internal static System.Drawing.Bitmap LineColorHS {
get {
object obj = ResourceManager.GetObject("LineColorHS", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
} }
} }

View File

@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
@ -60,6 +60,7 @@
: and then encoded with base64 encoding. : 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: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:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
@ -68,9 +69,10 @@
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" /> <xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" /> <xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" /> <xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" /> <xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="assembly"> <xsd:element name="assembly">
@ -85,9 +87,10 @@
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <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:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> <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="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
@ -109,9 +112,25 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="Clock" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\clock.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="DeleteHS" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\deletehs.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="GoToNextMessage" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\gotonextmessage.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="GoToPreviousMessage" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\gotopreviousmessage.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LineColorHS" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\linecolorhs.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

View File

@ -11,6 +11,23 @@
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<TargetFrameworkProfile /> <TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@ -22,6 +39,7 @@
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit> <Prefer32Bit>false</Prefer32Bit>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@ -37,10 +55,6 @@
<ApplicationIcon>gaim_48px_29650_easyicon.net.ico</ApplicationIcon> <ApplicationIcon>gaim_48px_29650_easyicon.net.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="FastColoredTextBox, Version=2.7.2.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Bin\Debug\SuperDesign\FastColoredTextBox.dll</HintPath>
</Reference>
<Reference Include="MyDb"> <Reference Include="MyDb">
<HintPath>..\..\Bin\Debug\SupperDesign\MyDb.dll</HintPath> <HintPath>..\..\Bin\Debug\SupperDesign\MyDb.dll</HintPath>
</Reference> </Reference>
@ -54,11 +68,17 @@
<Reference Include="ryControls"> <Reference Include="ryControls">
<HintPath>..\..\Bin\Debug\SupperDesign\ryControls.dll</HintPath> <HintPath>..\..\Bin\Debug\SupperDesign\ryControls.dll</HintPath>
</Reference> </Reference>
<Reference Include="Scintilla.NET, Version=5.3.2.1, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Bin\Debug\SuperDesign\Scintilla.NET.dll</HintPath>
</Reference>
<Reference Include="System"> <Reference Include="System">
<HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.dll</HintPath> <HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.dll</HintPath>
</Reference> </Reference>
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Design" /> <Reference Include="System.Design" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
@ -81,11 +101,12 @@
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Controls\ContextMenuStripHighlightText.cs"> <Compile Include="Controls\Highlight\CharacterRange.cs" />
<Compile Include="Controls\Highlight\ContextMenuStripHighlightText2.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
<Compile Include="Controls\ContextMenuStripHighlightText.Designer.cs"> <Compile Include="Controls\Highlight\ContextMenuStripHighlightText2.Designer.cs">
<DependentUpon>ContextMenuStripHighlightText.cs</DependentUpon> <DependentUpon>ContextMenuStripHighlightText2.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Controls\ContextMenuStripRichText.cs"> <Compile Include="Controls\ContextMenuStripRichText.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
@ -111,6 +132,79 @@
<Compile Include="Controls\FrmTitle.Designer.cs"> <Compile Include="Controls\FrmTitle.Designer.cs">
<DependentUpon>FrmTitle.cs</DependentUpon> <DependentUpon>FrmTitle.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Controls\Highlight\FindAllResults\FindAllResultsPanel.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\Highlight\FindAllResults\FindAllResultsPanel.Designer.cs">
<DependentUpon>FindAllResultsPanel.cs</DependentUpon>
</Compile>
<Compile Include="Controls\Highlight\FindReplace\FindOption.cs" />
<Compile Include="Controls\Highlight\FindReplace\FindReplace.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\Highlight\FindReplace\FindReplaceDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Controls\Highlight\FindReplace\FindReplaceDialog.Designer.cs">
<DependentUpon>FindReplaceDialog.cs</DependentUpon>
</Compile>
<Compile Include="Controls\Highlight\FindReplace\IncrementalSearcher.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Controls\Highlight\FindReplace\IncrementalSearcher.Designer.cs">
<DependentUpon>IncrementalSearcher.cs</DependentUpon>
</Compile>
<Compile Include="Controls\Highlight\FindReplace\ToolStripIncrementalSearcher.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\Highlight\FrmFindOrReplace.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Controls\Highlight\FrmFindOrReplace.Designer.cs">
<DependentUpon>FrmFindOrReplace.cs</DependentUpon>
</Compile>
<Compile Include="Controls\Highlight\GoTo\GoTo.cs" />
<Compile Include="Controls\Highlight\GoTo\GoToDialog.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Controls\Highlight\GoTo\GoToDialog.Designer.cs">
<DependentUpon>GoToDialog.cs</DependentUpon>
</Compile>
<Compile Include="Controls\Highlight\HighlightEditor.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerBatch.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerCommon.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerCpp.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerCs.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerCss.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerHtml.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerIni.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerInnoSetup.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerJava.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerJavaScript.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerJson.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerNsis.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerNull.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerPascal.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerPhp.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerPowerShell.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerPython.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerSql.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerVb.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerXml.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\CreateLexerYaml.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\CreateSpecificLexer\LexerFoldProperties.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\GlobalScintillaFont.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\HelperClasses\LexerFileExtensions.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\HelperClasses\LexerTypeName.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\HelperClasses\ScintillaKeyWords.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\LexerColors\LexerColors.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\LexerEnumerations.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\ScintillaLexers.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\ScintillaNotepadPlusPlus\MarkColors.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\ScintillaNotepadPlusPlus\ScintillaNotepadPlusPlusStyles.cs" />
<Compile Include="Controls\Highlight\VPKSoft.ScintillaLexers\ScintillaNotepadPlusPlus\XmlStyleNotepadPlusPlusHelper.cs" />
<Compile Include="Controls\MenuRight.cs"> <Compile Include="Controls\MenuRight.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
</Compile> </Compile>
@ -143,6 +237,7 @@
<DependentUpon>FrmSetting.cs</DependentUpon> <DependentUpon>FrmSetting.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Manager\HtmlFormater.cs" /> <Compile Include="Manager\HtmlFormater.cs" />
<Compile Include="Manager\HtmlIndent.cs" />
<Compile Include="Manager\Init.cs" /> <Compile Include="Manager\Init.cs" />
<Compile Include="Manager\JsonSplit.cs" /> <Compile Include="Manager\JsonSplit.cs" />
<Compile Include="Manager\ClsPY.cs" /> <Compile Include="Manager\ClsPY.cs" />
@ -159,6 +254,18 @@
<Compile Include="Manager\TotalCount.cs" /> <Compile Include="Manager\TotalCount.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tools\API\APIEditor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Tools\API\APIEditor.Designer.cs">
<DependentUpon>APIEditor.cs</DependentUpon>
</Compile>
<Compile Include="Tools\API\FrmAddPostParam.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Tools\API\FrmAddPostParam.Designer.cs">
<DependentUpon>FrmAddPostParam.cs</DependentUpon>
</Compile>
<Compile Include="Tools\FrmColor.cs"> <Compile Include="Tools\FrmColor.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@ -261,8 +368,8 @@
<Compile Include="Tools\FrmXpath.Designer.cs"> <Compile Include="Tools\FrmXpath.Designer.cs">
<DependentUpon>FrmXpath.cs</DependentUpon> <DependentUpon>FrmXpath.cs</DependentUpon>
</Compile> </Compile>
<EmbeddedResource Include="Controls\ContextMenuStripHighlightText.resx"> <EmbeddedResource Include="Controls\Highlight\ContextMenuStripHighlightText2.resx">
<DependentUpon>ContextMenuStripHighlightText.cs</DependentUpon> <DependentUpon>ContextMenuStripHighlightText2.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Controls\ContextMenuStripRichText.resx"> <EmbeddedResource Include="Controls\ContextMenuStripRichText.resx">
<DependentUpon>ContextMenuStripRichText.cs</DependentUpon> <DependentUpon>ContextMenuStripRichText.cs</DependentUpon>
@ -276,6 +383,24 @@
<EmbeddedResource Include="Controls\FrmTitle.resx"> <EmbeddedResource Include="Controls\FrmTitle.resx">
<DependentUpon>FrmTitle.cs</DependentUpon> <DependentUpon>FrmTitle.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Controls\Highlight\FindAllResults\FindAllResultsPanel.resx">
<DependentUpon>FindAllResultsPanel.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\Highlight\FindReplace\FindReplaceDialog.resx">
<DependentUpon>FindReplaceDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\Highlight\FindReplace\IncrementalSearcher.resx">
<DependentUpon>IncrementalSearcher.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\Highlight\FrmFindOrReplace.resx">
<DependentUpon>FrmFindOrReplace.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\Highlight\GoTo\GoToDialog.resx">
<DependentUpon>GoToDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Controls\Highlight\HighlightEditor.resx">
<DependentUpon>HighlightEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx"> <EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@ -301,6 +426,12 @@
<DependentUpon>Resources.resx</DependentUpon> <DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<EmbeddedResource Include="Tools\API\APIEditor.resx">
<DependentUpon>APIEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Tools\API\FrmAddPostParam.resx">
<DependentUpon>FrmAddPostParam.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Tools\FrmColor.resx"> <EmbeddedResource Include="Tools\FrmColor.resx">
<DependentUpon>FrmColor.cs</DependentUpon> <DependentUpon>FrmColor.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@ -353,6 +484,7 @@
<DependentUpon>FrmXpath.cs</DependentUpon> <DependentUpon>FrmXpath.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<None Include="app.config" /> <None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
@ -365,11 +497,36 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="gaim_48px_29650_easyicon.net.ico" /> <Content Include="gaim_48px_29650_easyicon.net.ico" />
<None Include="Resources\linecolorhs.png" />
<None Include="Resources\gotopreviousmessage.png" />
<None Include="Resources\gotonextmessage.png" />
<None Include="Resources\deletehs.png" />
<None Include="Resources\clock.png" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5.2 %28x86 和 x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup> </ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PreBuildEvent> <PreBuildEvent>
</PreBuildEvent> </PreBuildEvent>
</PropertyGroup> </PropertyGroup>
<Import Project="..\packages\Microsoft.Web.WebView2.1.0.1370.28\build\Microsoft.Web.WebView2.targets" Condition="Exists('..\packages\Microsoft.Web.WebView2.1.0.1370.28\build\Microsoft.Web.WebView2.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Microsoft.Web.WebView2.1.0.1370.28\build\Microsoft.Web.WebView2.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.Web.WebView2.1.0.1370.28\build\Microsoft.Web.WebView2.targets'))" />
<Error Condition="!Exists('..\packages\Scintilla.NET.5.3.2.2\build\scintilla.net.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Scintilla.NET.5.3.2.2\build\scintilla.net.targets'))" />
</Target>
<Import Project="..\packages\Scintilla.NET.5.3.2.2\build\scintilla.net.targets" Condition="Exists('..\packages\Scintilla.NET.5.3.2.2\build\scintilla.net.targets')" />
</Project> </Project>

View File

@ -1,9 +1,18 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartArguments>get "E:\我的代码\网上源码\ProgramCalculator\FRData\FRData.csproj"</StartArguments> <StartArguments>
</StartArguments>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<ProjectView>ProjectFiles</ProjectView> <ProjectView>ShowAllFiles</ProjectView>
<PublishUrlHistory>publish\</PublishUrlHistory>
<InstallUrlHistory />
<SupportUrlHistory />
<UpdateUrlHistory />
<BootstrapperUrlHistory />
<ErrorReportUrlHistory />
<FallbackCulture>zh-CN</FallbackCulture>
<VerifyUploadedFiles>false</VerifyUploadedFiles>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -18,7 +18,17 @@ namespace 开发辅助工具.Tools
{ {
InitializeComponent(); InitializeComponent();
} }
public string CSharpColorToDelphiColor(Color csharpColor)
{
//去掉透明度
int iColor = csharpColor.ToArgb();
int delphi_color_int = (iColor >> 16) + (iColor & 0x00FF00) + ((iColor & 0x0000FF) << 16);
Color delphi_color = Color.FromArgb(delphi_color_int);
//转换颜色位置
return string.Format("${0:X2}{1:X2}{2:X2}{3:X2}",
delphi_color.A, delphi_color.R, delphi_color.G, delphi_color.B);
}
private void SuperColor1_BackColorChanged(object sender, EventArgs e) private void SuperColor1_BackColorChanged(object sender, EventArgs e)
{ {
Color color = superColor1.BackColor; Color color = superColor1.BackColor;
@ -30,6 +40,7 @@ namespace 开发辅助工具.Tools
AddList("RGBA颜色值", "rgba(" + color.R + "," + color.G + "," + color.B + "," + color.A + ")", "HTML5、CSS3常用"); AddList("RGBA颜色值", "rgba(" + color.R + "," + color.G + "," + color.B + "," + color.A + ")", "HTML5、CSS3常用");
AddList("ARGB颜色值", String.Format("#{0:X2}{1:X2}{2:X2}{3:X2}", color.A, color.R, color.G, color.B), "android常用"); AddList("ARGB颜色值", String.Format("#{0:X2}{1:X2}{2:X2}{3:X2}", color.A, color.R, color.G, color.B), "android常用");
AddList("16进制颜色值", String.Format("#{0:X2}{1:X2}{2:X2}", color.R, color.G, color.B), ""); AddList("16进制颜色值", String.Format("#{0:X2}{1:X2}{2:X2}", color.R, color.G, color.B), "");
AddList("Delphi颜色值", CSharpColorToDelphiColor(color), "");
AddList("HSL颜色值", "hsl(" + color.GetHue().ToString("0.00") + "," + color.GetSaturation().ToString("0.00%") + "," + (hsl.L / 255m).ToString("0.00%") + ")", ""); AddList("HSL颜色值", "hsl(" + color.GetHue().ToString("0.00") + "," + color.GetSaturation().ToString("0.00%") + "," + (hsl.L / 255m).ToString("0.00%") + ")", "");
AddList("HSV颜色值", "hsv(" + color.GetHue().ToString("0.00") + "," + (hsv.S / 255m).ToString("0.00") + "," + (hsv.V / 255m).ToString("0.00") + ")", ""); AddList("HSV颜色值", "hsv(" + color.GetHue().ToString("0.00") + "," + (hsv.S / 255m).ToString("0.00") + "," + (hsv.V / 255m).ToString("0.00") + ")", "");
ColorHelper.RGB2CMYK(RGB, out var c, out var m, out var y, out var k); ColorHelper.RGB2CMYK(RGB, out var c, out var m, out var y, out var k);

View File

@ -37,7 +37,6 @@
this.RbURLEncode = new System.Windows.Forms.RadioButton(); this.RbURLEncode = new System.Windows.Forms.RadioButton();
this.RbBase64Decode = new System.Windows.Forms.RadioButton(); this.RbBase64Decode = new System.Windows.Forms.RadioButton();
this.RbBase64Encode = new System.Windows.Forms.RadioButton(); this.RbBase64Encode = new System.Windows.Forms.RadioButton();
this.TxtResultCode = new ryControls.TextBoxEx2();
this.menuRight1 = new ryPaiban.Model.MenuRight(this.components); this.menuRight1 = new ryPaiban.Model.MenuRight(this.components);
this.RbChsToUTF8 = new System.Windows.Forms.RadioButton(); this.RbChsToUTF8 = new System.Windows.Forms.RadioButton();
this.RbUTF8ToChs = new System.Windows.Forms.RadioButton(); this.RbUTF8ToChs = new System.Windows.Forms.RadioButton();
@ -47,6 +46,10 @@
this.RbSHA224 = new System.Windows.Forms.RadioButton(); this.RbSHA224 = new System.Windows.Forms.RadioButton();
this.RbSHA512 = new System.Windows.Forms.RadioButton(); this.RbSHA512 = new System.Windows.Forms.RadioButton();
this.TxtFromCode = new ryControls.Controls.RichTextBox2(); this.TxtFromCode = new ryControls.Controls.RichTextBox2();
this.RbJsonToXML = new System.Windows.Forms.RadioButton();
this.TxtResultCode = new ryControls.Controls.RichTextBox2();
this.RbBigToSmall = new System.Windows.Forms.RadioButton();
this.RbSmallToBig = new System.Windows.Forms.RadioButton();
this.SuspendLayout(); this.SuspendLayout();
// //
// RbChsToUnicode // RbChsToUnicode
@ -136,29 +139,6 @@
this.RbBase64Encode.UseVisualStyleBackColor = true; this.RbBase64Encode.UseVisualStyleBackColor = true;
this.RbBase64Encode.CheckedChanged += new System.EventHandler(this.RbBase64Encode_CheckedChanged); this.RbBase64Encode.CheckedChanged += new System.EventHandler(this.RbBase64Encode_CheckedChanged);
// //
// TxtResultCode
//
this.TxtResultCode.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.TxtResultCode.BackColor = System.Drawing.Color.White;
this.TxtResultCode.EmptyText = "转换好后的内容";
this.TxtResultCode.Location = new System.Drawing.Point(12, 234);
this.TxtResultCode.MaxLength = 999999999;
this.TxtResultCode.Multiline = true;
this.TxtResultCode.Name = "TxtResultCode";
this.TxtResultCode.OnlyNumeric = false;
this.TxtResultCode.PasswordChar = '\0';
this.TxtResultCode.ReadOnly = true;
this.TxtResultCode.SelectedText = "";
this.TxtResultCode.SelectionLength = 0;
this.TxtResultCode.SelectionStart = 0;
this.TxtResultCode.Size = new System.Drawing.Size(926, 209);
this.TxtResultCode.TabIndex = 14;
this.TxtResultCode.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.TxtResultCode.ToolTip = "";
this.TxtResultCode.WordWrap = true;
//
// menuRight1 // menuRight1
// //
this.menuRight1.Name = "menuRight1"; this.menuRight1.Name = "menuRight1";
@ -250,6 +230,7 @@
this.TxtFromCode.BorderStyle = System.Windows.Forms.BorderStyle.None; this.TxtFromCode.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.TxtFromCode.DetectUrls = false; this.TxtFromCode.DetectUrls = false;
this.TxtFromCode.EmptyText = "请填写待转换的内容"; this.TxtFromCode.EmptyText = "请填写待转换的内容";
this.TxtFromCode.Font = new System.Drawing.Font("Courier New", 10F);
this.TxtFromCode.ForeColor = System.Drawing.Color.Black; this.TxtFromCode.ForeColor = System.Drawing.Color.Black;
this.TxtFromCode.Location = new System.Drawing.Point(12, 54); this.TxtFromCode.Location = new System.Drawing.Point(12, 54);
this.TxtFromCode.Name = "TxtFromCode"; this.TxtFromCode.Name = "TxtFromCode";
@ -257,14 +238,72 @@
this.TxtFromCode.Size = new System.Drawing.Size(926, 174); this.TxtFromCode.Size = new System.Drawing.Size(926, 174);
this.TxtFromCode.TabIndex = 29; this.TxtFromCode.TabIndex = 29;
this.TxtFromCode.Text = ""; this.TxtFromCode.Text = "";
this.TxtFromCode.WordWrap = false;
this.TxtFromCode.TextChanged += new System.EventHandler(this.TxtFromCode_TextChanged); this.TxtFromCode.TextChanged += new System.EventHandler(this.TxtFromCode_TextChanged);
this.TxtFromCode.DoubleClick += new System.EventHandler(this.TxtFromCode_DoubleClick_1); this.TxtFromCode.DoubleClick += new System.EventHandler(this.TxtFromCode_DoubleClick_1);
// //
// RbJsonToXML
//
this.RbJsonToXML.AutoSize = true;
this.RbJsonToXML.Location = new System.Drawing.Point(379, 32);
this.RbJsonToXML.Name = "RbJsonToXML";
this.RbJsonToXML.Size = new System.Drawing.Size(77, 16);
this.RbJsonToXML.TabIndex = 30;
this.RbJsonToXML.Text = "Json=>XML";
this.RbJsonToXML.UseVisualStyleBackColor = true;
this.RbJsonToXML.CheckedChanged += new System.EventHandler(this.RbJsonToXML_CheckedChanged);
//
// TxtResultCode
//
this.TxtResultCode.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.TxtResultCode.BackColor = System.Drawing.Color.White;
this.TxtResultCode.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.TxtResultCode.DetectUrls = false;
this.TxtResultCode.EmptyText = "转换好后的内容";
this.TxtResultCode.Font = new System.Drawing.Font("Courier New", 10F);
this.TxtResultCode.ForeColor = System.Drawing.Color.Black;
this.TxtResultCode.Location = new System.Drawing.Point(12, 234);
this.TxtResultCode.Name = "TxtResultCode";
this.TxtResultCode.OnlyInputText = true;
this.TxtResultCode.ReadOnly = true;
this.TxtResultCode.Size = new System.Drawing.Size(926, 204);
this.TxtResultCode.TabIndex = 31;
this.TxtResultCode.Text = "";
this.TxtResultCode.WordWrap = false;
//
// RbBigToSmall
//
this.RbBigToSmall.AutoSize = true;
this.RbBigToSmall.Location = new System.Drawing.Point(473, 32);
this.RbBigToSmall.Name = "RbBigToSmall";
this.RbBigToSmall.Size = new System.Drawing.Size(59, 16);
this.RbBigToSmall.TabIndex = 32;
this.RbBigToSmall.Text = "转小写";
this.RbBigToSmall.UseVisualStyleBackColor = true;
this.RbBigToSmall.CheckedChanged += new System.EventHandler(this.RbBigToSmall_CheckedChanged);
//
// RbSmallToBig
//
this.RbSmallToBig.AutoSize = true;
this.RbSmallToBig.Location = new System.Drawing.Point(550, 32);
this.RbSmallToBig.Name = "RbSmallToBig";
this.RbSmallToBig.Size = new System.Drawing.Size(59, 16);
this.RbSmallToBig.TabIndex = 33;
this.RbSmallToBig.Text = "转大写";
this.RbSmallToBig.UseVisualStyleBackColor = true;
this.RbSmallToBig.CheckedChanged += new System.EventHandler(this.RbSmallToBig_CheckedChanged);
//
// FrmEncode // FrmEncode
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(950, 450); this.ClientSize = new System.Drawing.Size(950, 450);
this.Controls.Add(this.RbSmallToBig);
this.Controls.Add(this.RbBigToSmall);
this.Controls.Add(this.TxtResultCode);
this.Controls.Add(this.RbJsonToXML);
this.Controls.Add(this.TxtFromCode); this.Controls.Add(this.TxtFromCode);
this.Controls.Add(this.RbSHA512); this.Controls.Add(this.RbSHA512);
this.Controls.Add(this.RbSHA224); this.Controls.Add(this.RbSHA224);
@ -280,7 +319,6 @@
this.Controls.Add(this.RbURLEncode); this.Controls.Add(this.RbURLEncode);
this.Controls.Add(this.RbBase64Decode); this.Controls.Add(this.RbBase64Decode);
this.Controls.Add(this.RbBase64Encode); this.Controls.Add(this.RbBase64Encode);
this.Controls.Add(this.TxtResultCode);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FrmEncode"; this.Name = "FrmEncode";
this.TabPageContextMenuStrip = this.menuRight1; this.TabPageContextMenuStrip = this.menuRight1;
@ -299,7 +337,6 @@
private System.Windows.Forms.RadioButton RbURLEncode; private System.Windows.Forms.RadioButton RbURLEncode;
private System.Windows.Forms.RadioButton RbBase64Decode; private System.Windows.Forms.RadioButton RbBase64Decode;
private System.Windows.Forms.RadioButton RbBase64Encode; private System.Windows.Forms.RadioButton RbBase64Encode;
private ryControls.TextBoxEx2 TxtResultCode;
private ryPaiban.Model.MenuRight menuRight1; private ryPaiban.Model.MenuRight menuRight1;
private System.Windows.Forms.RadioButton RbChsToUTF8; private System.Windows.Forms.RadioButton RbChsToUTF8;
private System.Windows.Forms.RadioButton RbUTF8ToChs; private System.Windows.Forms.RadioButton RbUTF8ToChs;
@ -308,6 +345,10 @@
private System.Windows.Forms.RadioButton RbSHA256; private System.Windows.Forms.RadioButton RbSHA256;
private System.Windows.Forms.RadioButton RbSHA224; private System.Windows.Forms.RadioButton RbSHA224;
private System.Windows.Forms.RadioButton RbSHA512; private System.Windows.Forms.RadioButton RbSHA512;
private ryControls.Controls.RichTextBox2 TxtFromCode; private ryControls.Controls.RichTextBox2 TxtFromCode;
private System.Windows.Forms.RadioButton RbJsonToXML;
private ryControls.Controls.RichTextBox2 TxtResultCode;
private System.Windows.Forms.RadioButton RbBigToSmall;
private System.Windows.Forms.RadioButton RbSmallToBig;
} }
} }

View File

@ -1,13 +1,16 @@
using System; using Newtonsoft.Json;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
using System.Drawing; using System.Drawing;
using System.IO;
using System.Linq; using System.Linq;
using System.Security.Cryptography; using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Windows.Forms; using System.Windows.Forms;
using System.Xml;
using WeifenLuo.WinFormsUI.Docking; using WeifenLuo.WinFormsUI.Docking;
namespace .Tools namespace .Tools
@ -128,6 +131,26 @@ namespace 开发辅助工具.Tools
catch { TxtResultCode.Text = ""; } catch { TxtResultCode.Text = ""; }
#endregion #endregion
} }
else if (RbBigToSmall.Checked)
{
#region
try
{
TxtResultCode.Text =from_text.ToLower();
}
catch { TxtResultCode.Text = ""; }
#endregion
}
else if (RbSmallToBig.Checked)
{
#region
try
{
TxtResultCode.Text = from_text.ToUpper();
}
catch { TxtResultCode.Text = ""; }
#endregion
}
else if (RbMD5.Checked) else if (RbMD5.Checked)
{ {
#region MD5 #region MD5
@ -178,6 +201,53 @@ namespace 开发辅助工具.Tools
catch { TxtResultCode.Text = ""; } catch { TxtResultCode.Text = ""; }
#endregion #endregion
} }
else if (RbJsonToXML.Checked)
{
#region JSON=>XML
try
{
string json1 = @"{
""?xml"": {
""@version"": ""1.0"",
""@standalone"": ""no""
},
""root"":" + from_text + "}";
System.Xml.XmlDocument doc1 = JsonConvert.DeserializeXmlNode(json1);
TxtResultCode.Text = formatXml(doc1);
}
catch { TxtResultCode.Text = ""; }
#endregion
}
}
private static string formatXml(object xml)
{
XmlDocument xd;
if (xml is XmlDocument)
{
xd = xml as XmlDocument;
}
else
{
xd = new XmlDocument();
xd.LoadXml(xml as string);
}
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
XmlTextWriter xtw = null;
try
{
xtw = new XmlTextWriter(sw);
xtw.Formatting = System.Xml.Formatting.Indented;
xtw.Indentation = 1;
xtw.IndentChar = '\t';
xd.WriteTo(xtw);
}
finally
{
if (xtw != null)
xtw.Close();
}
return sb.ToString();
} }
public string get_uft8(string unicodeString) public string get_uft8(string unicodeString)
{ {
@ -254,5 +324,35 @@ namespace 开发辅助工具.Tools
txt.Text = frm.richTextBox1.Text; txt.Text = frm.richTextBox1.Text;
} }
} }
private void RbJsonToXML_CheckedChanged(object sender, EventArgs e)
{
RadioButton chk = (RadioButton)sender;
if (chk.Checked)
{
CbbEncodingCode.Enabled = false;
}
AutoCode();
}
private void RbBigToSmall_CheckedChanged(object sender, EventArgs e)
{
RadioButton chk = (RadioButton)sender;
if (chk.Checked)
{
CbbEncodingCode.Enabled = false;
}
AutoCode();
}
private void RbSmallToBig_CheckedChanged(object sender, EventArgs e)
{
RadioButton chk = (RadioButton)sender;
if (chk.Checked)
{
CbbEncodingCode.Enabled = false;
}
AutoCode();
}
} }
} }

View File

@ -31,7 +31,6 @@
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmJson)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmJson));
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.textEditorControl1 = new FastColoredTextBoxNS.FastColoredTextBox();
this.treeView1 = new System.Windows.Forms.TreeView(); this.treeView1 = new System.Windows.Forms.TreeView();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -39,13 +38,13 @@
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
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.contextMenuStripHighlightText1 = new ryProcessManager.hezuo.ContextMenuStripHighlightText();
this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.BtnFormat = new System.Windows.Forms.ToolStripButton(); this.BtnFormat = new System.Windows.Forms.ToolStripButton();
this.BtnPasteJson = new System.Windows.Forms.ToolStripButton(); this.BtnPasteJson = new System.Windows.Forms.ToolStripButton();
this.BtnCopyJson = new System.Windows.Forms.ToolStripButton(); this.BtnCopyJson = new System.Windows.Forms.ToolStripButton();
this.CopyJsonByCHS = new System.Windows.Forms.ToolStripButton(); this.CopyJsonByCHS = new System.Windows.Forms.ToolStripButton();
this.menuRight1 = new ryPaiban.Model.MenuRight(this.components); this.menuRight1 = new ryPaiban.Model.MenuRight(this.components);
this.highlightEditor1 = new ryControls.HighlightEditor();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
@ -62,7 +61,7 @@
// //
// splitContainer1.Panel1 // splitContainer1.Panel1
// //
this.splitContainer1.Panel1.Controls.Add(this.textEditorControl1); this.splitContainer1.Panel1.Controls.Add(this.highlightEditor1);
// //
// splitContainer1.Panel2 // splitContainer1.Panel2
// //
@ -70,16 +69,6 @@
this.splitContainer1.Size = new System.Drawing.Size(800, 491); this.splitContainer1.Size = new System.Drawing.Size(800, 491);
this.splitContainer1.SplitterDistance = 400; this.splitContainer1.SplitterDistance = 400;
this.splitContainer1.TabIndex = 0; this.splitContainer1.TabIndex = 0;
this.textEditorControl1.AutoScrollMinSize = new System.Drawing.Size(27, 14);
this.textEditorControl1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.textEditorControl1.ContextMenuStrip = this.contextMenuStripHighlightText1;
this.textEditorControl1.Cursor = System.Windows.Forms.Cursors.IBeam;
this.textEditorControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.textEditorControl1.Font = new System.Drawing.Font("Courier New", 9.75F);
this.textEditorControl1.Location = new System.Drawing.Point(0, 0);
this.textEditorControl1.Name = "textEditorControl1";
this.textEditorControl1.Size = new System.Drawing.Size(400, 491);
this.textEditorControl1.TabIndex = 23;
// //
// treeView1 // treeView1
// //
@ -139,11 +128,6 @@
this.ToolStripMenuItem.Text = "折叠"; this.ToolStripMenuItem.Text = "折叠";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
// contextMenuStripHighlightText1
//
this.contextMenuStripHighlightText1.Name = "contextMenuStripHighlightText1";
this.contextMenuStripHighlightText1.Size = new System.Drawing.Size(101, 186);
//
// toolStrip1 // toolStrip1
// //
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -203,6 +187,23 @@
this.menuRight1.Size = new System.Drawing.Size(185, 92); this.menuRight1.Size = new System.Drawing.Size(185, 92);
this.menuRight1.SourceContent = this; this.menuRight1.SourceContent = this;
// //
// highlightEditor1
//
this.highlightEditor1.AutoCMaxHeight = 9;
this.highlightEditor1.BiDirectionality = ScintillaNET.BiDirectionalDisplayType.Disabled;
this.highlightEditor1.CaretLineBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
this.highlightEditor1.CaretLineVisible = true;
this.highlightEditor1.Dock = System.Windows.Forms.DockStyle.Fill;
this.highlightEditor1.LexerName = null;
this.highlightEditor1.Location = new System.Drawing.Point(0, 0);
this.highlightEditor1.Name = "highlightEditor1";
this.highlightEditor1.ScrollWidth = 88;
this.highlightEditor1.Size = new System.Drawing.Size(400, 491);
this.highlightEditor1.TabIndents = true;
this.highlightEditor1.TabIndex = 0;
this.highlightEditor1.UseRightToLeftReadingLayout = false;
this.highlightEditor1.WrapMode = ScintillaNET.WrapMode.None;
//
// FrmJson // FrmJson
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -231,7 +232,6 @@
private System.Windows.Forms.SplitContainer splitContainer1; private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.TreeView treeView1; private System.Windows.Forms.TreeView treeView1;
private ryProcessManager.hezuo.ContextMenuStripHighlightText contextMenuStripHighlightText1;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
@ -244,6 +244,6 @@
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripButton CopyJsonByCHS; private System.Windows.Forms.ToolStripButton CopyJsonByCHS;
private FastColoredTextBoxNS.FastColoredTextBox textEditorControl1; private ryControls.HighlightEditor highlightEditor1;
} }
} }

View File

@ -1,5 +1,4 @@
using FastColoredTextBoxNS; using Newtonsoft.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -19,51 +18,6 @@ namespace 开发辅助工具.Tools
public FrmJson() public FrmJson()
{ {
InitializeComponent(); InitializeComponent();
textEditorControl1.ClearStylesBuffer();
textEditorControl1.Range.ClearStyle(StyleIndex.All);
textEditorControl1.AddStyle(new MarkerStyle(new SolidBrush(Color.FromArgb(40, Color.Gray))));
textEditorControl1.AutoIndentNeeded -= fctb_AutoIndentNeeded;
textEditorControl1.Language = Language.JSON;
textEditorControl1.OnSyntaxHighlight(new TextChangedEventArgs(textEditorControl1.Range));
}
private void fctb_AutoIndentNeeded(object sender, AutoIndentEventArgs args)
{
//block {}
if (Regex.IsMatch(args.LineText, @"^[^""']*\{.*\}[^""']*$"))
return;
//start of block {}
if (Regex.IsMatch(args.LineText, @"^[^""']*\{"))
{
args.ShiftNextLines = args.TabLength;
return;
}
//end of block {}
if (Regex.IsMatch(args.LineText, @"}[^""']*$"))
{
args.Shift = -args.TabLength;
args.ShiftNextLines = -args.TabLength;
return;
}
//label
if (Regex.IsMatch(args.LineText, @"^\s*\w+\s*:\s*($|//)") &&
!Regex.IsMatch(args.LineText, @"^\s*default\s*:"))
{
args.Shift = -args.TabLength;
return;
}
//some statements: case, default
if (Regex.IsMatch(args.LineText, @"^\s*(case|default)\b.*:\s*($|//)"))
{
args.Shift = -args.TabLength / 2;
return;
}
//is unclosed operator in previous line ?
if (Regex.IsMatch(args.PrevLineText, @"^\s*(if|for|foreach|while|[\}\s]*else)\b[^{]*$"))
if (!Regex.IsMatch(args.PrevLineText, @"(;\s*$)|(;\s*//)"))//operator is unclosed
{
args.Shift = args.TabLength;
return;
}
} }
private void LoadTreeList(TreeNodeCollection nodes,JObject jo) private void LoadTreeList(TreeNodeCollection nodes,JObject jo)
{ {
@ -119,8 +73,8 @@ namespace 开发辅助工具.Tools
{ {
try try
{ {
textEditorControl1.Text = Manager.Json.ConvertJsonString(json_text); highlightEditor1.SetHightlightText(Manager.Json.ConvertJsonString(json_text),"json");
textEditorControl1.Refresh(); highlightEditor1.Refresh();
JObject jo = null; JObject jo = null;
if (Manager.Json.IsArray(json_text)) if (Manager.Json.IsArray(json_text))
{ {
@ -225,12 +179,12 @@ namespace 开发辅助工具.Tools
} }
private void BtnFormat_Click(object sender, EventArgs e) private void BtnFormat_Click(object sender, EventArgs e)
{ {
Format(textEditorControl1.Text); Format(highlightEditor1.Text);
} }
public void LoadJson(string json_text) public void LoadJson(string json_text)
{ {
textEditorControl1.Text = json_text; highlightEditor1.SetHightlightText(json_text,"json");
textEditorControl1.Refresh(); highlightEditor1.Refresh();
BtnFormat.PerformClick(); BtnFormat.PerformClick();
} }
private void ToolStripMenuItem_Click(object sender, EventArgs e) private void ToolStripMenuItem_Click(object sender, EventArgs e)
@ -255,7 +209,7 @@ namespace 开发辅助工具.Tools
private void BtnCopyJson_Click(object sender, EventArgs e) private void BtnCopyJson_Click(object sender, EventArgs e)
{ {
ryCommon.RyFiles.CopyToClip(textEditorControl1.Text); ryCommon.RyFiles.CopyToClip(highlightEditor1.Text);
} }
private void FrmJson_Load(object sender, EventArgs e) private void FrmJson_Load(object sender, EventArgs e)
@ -289,7 +243,7 @@ namespace 开发辅助工具.Tools
{ {
try try
{ {
JObject jo = (JObject)JsonConvert.DeserializeObject(textEditorControl1.Text); JObject jo = (JObject)JsonConvert.DeserializeObject(highlightEditor1.Text);
var aa = Newtonsoft.Json.JsonConvert.SerializeObject(jo, new Newtonsoft.Json.JsonSerializerSettings() { StringEscapeHandling = Newtonsoft.Json.StringEscapeHandling.EscapeNonAscii }); var aa = Newtonsoft.Json.JsonConvert.SerializeObject(jo, new Newtonsoft.Json.JsonSerializerSettings() { StringEscapeHandling = Newtonsoft.Json.StringEscapeHandling.EscapeNonAscii });
ryCommon.RyFiles.CopyToClip(aa); ryCommon.RyFiles.CopyToClip(aa);
} }

View File

@ -117,10 +117,6 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="contextMenuStripHighlightText1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>262, 17</value> <value>262, 17</value>
</metadata> </metadata>

View File

@ -154,23 +154,11 @@ namespace 开发辅助工具.Tools
string _ProjectPath = ""; string _ProjectPath = "";
private string GetPath(string _path) private string GetPath(string _path)
{ {
string tmp_path = _path; var cur_dir = Environment.CurrentDirectory;
if (_path.IndexOf("..") == 0) Environment.CurrentDirectory = System.IO.Path.GetDirectoryName(_ProjectPath);
{ var tmp_path = System.IO.Path.GetFullPath(_path);
tmp_path = System.IO.Path.GetDirectoryName(System.IO.Path.GetDirectoryName(_ProjectPath).Trim('\\')); Environment.CurrentDirectory = cur_dir;
tmp_path = tmp_path + "\\" + _path.Substring(2); return tmp_path;
}
else if (_path.IndexOf(".") == 0)
{
tmp_path = System.IO.Path.GetDirectoryName(_ProjectPath);
tmp_path = tmp_path + "\\" + _path.Substring(1);
}
else if (_path.IndexOf(":") < 0)
{
tmp_path = System.IO.Path.GetDirectoryName(_ProjectPath);
tmp_path = tmp_path + "\\" + _path;
}
return tmp_path.Replace("\\\\", "\\");
} }
private string GetDebugPath() private string GetDebugPath()
{ {

View File

@ -201,6 +201,7 @@
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.RySearchRegex.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(239)))), ((int)(((byte)(244))))); this.RySearchRegex.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(239)))), ((int)(((byte)(244)))));
this.RySearchRegex.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(76)))), ((int)(((byte)(95))))); this.RySearchRegex.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(76)))), ((int)(((byte)(95)))));
this.RySearchRegex.ButtonRoundBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(239)))), ((int)(((byte)(244)))));
this.RySearchRegex.EmptyText = ""; this.RySearchRegex.EmptyText = "";
this.RySearchRegex.Location = new System.Drawing.Point(81, 6); this.RySearchRegex.Location = new System.Drawing.Point(81, 6);
this.RySearchRegex.Name = "RySearchRegex"; this.RySearchRegex.Name = "RySearchRegex";
@ -220,7 +221,7 @@
// menuRight1 // menuRight1
// //
this.menuRight1.Name = "menuRight1"; this.menuRight1.Name = "menuRight1";
this.menuRight1.Size = new System.Drawing.Size(185, 70); this.menuRight1.Size = new System.Drawing.Size(185, 92);
this.menuRight1.SourceContent = this; this.menuRight1.SourceContent = this;
// //
// TxtRegexInput // TxtRegexInput
@ -230,6 +231,7 @@
this.TxtRegexInput.BorderStyle = System.Windows.Forms.BorderStyle.None; this.TxtRegexInput.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.TxtRegexInput.DetectUrls = false; this.TxtRegexInput.DetectUrls = false;
this.TxtRegexInput.EmptyText = "在此输入待匹配文本"; this.TxtRegexInput.EmptyText = "在此输入待匹配文本";
this.TxtRegexInput.Font = new System.Drawing.Font("Courier New", 10F);
this.TxtRegexInput.ForeColor = System.Drawing.Color.Black; this.TxtRegexInput.ForeColor = System.Drawing.Color.Black;
this.TxtRegexInput.Location = new System.Drawing.Point(12, 37); this.TxtRegexInput.Location = new System.Drawing.Point(12, 37);
this.TxtRegexInput.Name = "TxtRegexInput"; this.TxtRegexInput.Name = "TxtRegexInput";
@ -237,6 +239,7 @@
this.TxtRegexInput.Size = new System.Drawing.Size(825, 158); this.TxtRegexInput.Size = new System.Drawing.Size(825, 158);
this.TxtRegexInput.TabIndex = 18; this.TxtRegexInput.TabIndex = 18;
this.TxtRegexInput.Text = ""; this.TxtRegexInput.Text = "";
this.TxtRegexInput.WordWrap = false;
this.TxtRegexInput.DoubleClick += new System.EventHandler(this.TxtRegexInput_DoubleClick); this.TxtRegexInput.DoubleClick += new System.EventHandler(this.TxtRegexInput_DoubleClick);
// //
// FrmRegex // FrmRegex
@ -254,6 +257,7 @@
this.Name = "FrmRegex"; this.Name = "FrmRegex";
this.TabPageContextMenuStrip = this.menuRight1; this.TabPageContextMenuStrip = this.menuRight1;
this.Text = "正则表达式"; this.Text = "正则表达式";
this.Load += new System.EventHandler(this.FrmRegex_Load);
this.tabControl3.ResumeLayout(false); this.tabControl3.ResumeLayout(false);
this.TabTxtResult.ResumeLayout(false); this.TabTxtResult.ResumeLayout(false);
this.tabPage10.ResumeLayout(false); this.tabPage10.ResumeLayout(false);

View File

@ -41,7 +41,7 @@ namespace 开发辅助工具.Tools
{ {
option = RegexOptions.IgnoreCase; option = RegexOptions.IgnoreCase;
} }
if (Multiline) { option = option | RegexOptions.Multiline; } if (Multiline) { option |= RegexOptions.Multiline; }
Regex reg = new Regex(RegexText, option); Regex reg = new Regex(RegexText, option);
//返回一个结果集 //返回一个结果集
MatchCollection result = reg.Matches(RegexInput); MatchCollection result = reg.Matches(RegexInput);
@ -106,5 +106,9 @@ namespace 开发辅助工具.Tools
txt.Text = frm.richTextBox1.Text; txt.Text = frm.richTextBox1.Text;
} }
} }
private void FrmRegex_Load(object sender, EventArgs e)
{
}
} }
} }

View File

@ -30,17 +30,11 @@
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmStrCount)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmStrCount));
this.contextMenuStripHighlightText1 = new ryProcessManager.hezuo.ContextMenuStripHighlightText();
this.menuRight1 = new ryPaiban.Model.MenuRight(this.components); this.menuRight1 = new ryPaiban.Model.MenuRight(this.components);
this.TxtFromCode = new ryControls.Controls.RichTextBox2(); this.TxtFromCode = new ryControls.Controls.RichTextBox2();
this.fastColoredTextBox1 = new FastColoredTextBoxNS.FastColoredTextBox(); this.highlightEditor1 = new ryControls.HighlightEditor();
this.SuspendLayout(); this.SuspendLayout();
// //
// contextMenuStripHighlightText1
//
this.contextMenuStripHighlightText1.Name = "contextMenuStripHighlightText1";
this.contextMenuStripHighlightText1.Size = new System.Drawing.Size(101, 186);
//
// menuRight1 // menuRight1
// //
this.menuRight1.Name = "menuRight1"; this.menuRight1.Name = "menuRight1";
@ -54,6 +48,7 @@
this.TxtFromCode.BorderStyle = System.Windows.Forms.BorderStyle.None; this.TxtFromCode.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.TxtFromCode.DetectUrls = false; this.TxtFromCode.DetectUrls = false;
this.TxtFromCode.EmptyText = "请填写待计算的字符串"; this.TxtFromCode.EmptyText = "请填写待计算的字符串";
this.TxtFromCode.Font = new System.Drawing.Font("Courier New", 10F);
this.TxtFromCode.ForeColor = System.Drawing.Color.Black; this.TxtFromCode.ForeColor = System.Drawing.Color.Black;
this.TxtFromCode.Location = new System.Drawing.Point(12, 3); this.TxtFromCode.Location = new System.Drawing.Point(12, 3);
this.TxtFromCode.Name = "TxtFromCode"; this.TxtFromCode.Name = "TxtFromCode";
@ -61,41 +56,48 @@
this.TxtFromCode.Size = new System.Drawing.Size(812, 207); this.TxtFromCode.Size = new System.Drawing.Size(812, 207);
this.TxtFromCode.TabIndex = 30; this.TxtFromCode.TabIndex = 30;
this.TxtFromCode.Text = ""; this.TxtFromCode.Text = "";
this.TxtFromCode.WordWrap = false;
this.TxtFromCode.TextChanged += new System.EventHandler(this.TxtFromCode_TextChanged); this.TxtFromCode.TextChanged += new System.EventHandler(this.TxtFromCode_TextChanged);
// //
// fastColoredTextBox1 // highlightEditor1
// //
this.fastColoredTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.highlightEditor1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.fastColoredTextBox1.AutoScrollMinSize = new System.Drawing.Size(27, 14); this.highlightEditor1.AutoCAutoHide = false;
this.fastColoredTextBox1.ContextMenuStrip = this.contextMenuStripHighlightText1; this.highlightEditor1.AutoCMaxHeight = 9;
this.fastColoredTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam; this.highlightEditor1.BiDirectionality = ScintillaNET.BiDirectionalDisplayType.Disabled;
this.fastColoredTextBox1.Font = new System.Drawing.Font("Courier New", 9.75F); this.highlightEditor1.CaretLineBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
this.fastColoredTextBox1.Location = new System.Drawing.Point(12, 216); this.highlightEditor1.CaretLineVisible = true;
this.fastColoredTextBox1.Name = "fastColoredTextBox1"; this.highlightEditor1.LexerName = null;
this.fastColoredTextBox1.Size = new System.Drawing.Size(812, 277); this.highlightEditor1.Location = new System.Drawing.Point(12, 216);
this.fastColoredTextBox1.TabIndex = 31; this.highlightEditor1.Name = "highlightEditor1";
this.highlightEditor1.ScrollWidth = 88;
this.highlightEditor1.Size = new System.Drawing.Size(812, 258);
this.highlightEditor1.TabIndents = true;
this.highlightEditor1.TabIndex = 31;
this.highlightEditor1.UseRightToLeftReadingLayout = false;
this.highlightEditor1.WrapMode = ScintillaNET.WrapMode.None;
// //
// FrmStrCount // FrmStrCount
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(836, 495); this.ClientSize = new System.Drawing.Size(836, 495);
this.Controls.Add(this.fastColoredTextBox1); this.Controls.Add(this.highlightEditor1);
this.Controls.Add(this.TxtFromCode); this.Controls.Add(this.TxtFromCode);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FrmStrCount"; this.Name = "FrmStrCount";
this.TabPageContextMenuStrip = this.menuRight1; this.TabPageContextMenuStrip = this.menuRight1;
this.Text = "字符串统计"; this.Text = "字符串统计";
this.Load += new System.EventHandler(this.FrmStrCount_Load);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
#endregion #endregion
private ryProcessManager.hezuo.ContextMenuStripHighlightText contextMenuStripHighlightText1;
private ryPaiban.Model.MenuRight menuRight1; private ryPaiban.Model.MenuRight menuRight1;
private ryControls.Controls.RichTextBox2 TxtFromCode; private ryControls.Controls.RichTextBox2 TxtFromCode;
private FastColoredTextBoxNS.FastColoredTextBox fastColoredTextBox1; private ryControls.HighlightEditor highlightEditor1;
} }
} }

View File

@ -1,4 +1,5 @@
using System; using ryControls;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
@ -15,7 +16,7 @@ namespace 开发辅助工具.Tools
public FrmStrCount() public FrmStrCount()
{ {
InitializeComponent(); InitializeComponent();
fastColoredTextBox1.ReadOnly = true; highlightEditor1.ReadOnly = true;
} }
private void TxtFromCode_TextChanged(object sender, EventArgs e) private void TxtFromCode_TextChanged(object sender, EventArgs e)
@ -23,13 +24,20 @@ namespace 开发辅助工具.Tools
Manager.TotalCount totalCount = new Manager.TotalCount(); Manager.TotalCount totalCount = new Manager.TotalCount();
string fromText = TxtFromCode.Text; string fromText = TxtFromCode.Text;
int iCount = totalCount.GetByteLength(fromText, out int HanziCount, out int engCount, out int NumCount); int iCount = totalCount.GetByteLength(fromText, out int HanziCount, out int engCount, out int NumCount);
string resultStr = ""; string resultStr;
resultStr = "字节数: " + iCount.ToString() + "个(汉字算两个字符)"; resultStr = "字节数: " + iCount.ToString() + "个(汉字算两个字符)";
resultStr += "\r\n字数: " + fromText.Length.ToString() + "个(汉字算一个字符)"; resultStr += "\r\n字数: " + fromText.Length.ToString() + "个(汉字算一个字符)";
resultStr += "\r\n汉字数: " + HanziCount.ToString() + "个(汉字算一个字符)"; resultStr += "\r\n汉字数: " + HanziCount.ToString() + "个(汉字算一个字符)";
resultStr += "\r\n英文数量: " + engCount.ToString() + "个"; resultStr += "\r\n英文数量: " + engCount.ToString() + "个";
resultStr += "\r\n数字数量: " + NumCount.ToString() + "个"; resultStr += "\r\n数字数量: " + NumCount.ToString() + "个";
fastColoredTextBox1.Text = resultStr; highlightEditor1.ReadOnly = false;
highlightEditor1.Text = resultStr;
highlightEditor1.ReadOnly = true;
}
private void FrmStrCount_Load(object sender, EventArgs e)
{
highlightEditor1.SetFocus();
} }
} }
} }

View File

@ -117,13 +117,9 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="contextMenuStripHighlightText1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="menuRight1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="menuRight1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>262, 17</value> <value>262, 17</value>
</metadata> </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>

View File

@ -28,15 +28,13 @@
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmStrToCode)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmStrToCode));
this.RbStrToC = new System.Windows.Forms.RadioButton(); this.RbStrToC = new System.Windows.Forms.RadioButton();
this.RbStrToJS = new System.Windows.Forms.RadioButton(); this.RbStrToJS = new System.Windows.Forms.RadioButton();
this.RbStrToQuickJS = new System.Windows.Forms.RadioButton(); this.RbStrToQuickJS = new System.Windows.Forms.RadioButton();
this.RbStrToASP = new System.Windows.Forms.RadioButton(); this.RbStrToASP = new System.Windows.Forms.RadioButton();
this.TxtFromCode = new ryControls.Controls.RichTextBox2(); this.TxtFromCode = new ryControls.Controls.RichTextBox2();
this.fastColoredTextBox1 = new FastColoredTextBoxNS.FastColoredTextBox(); this.highlightEditor1 = new ryControls.HighlightEditor();
this.contextMenuStripHighlightText1 = new ryProcessManager.hezuo.ContextMenuStripHighlightText();
this.SuspendLayout(); this.SuspendLayout();
// //
// RbStrToC // RbStrToC
@ -91,6 +89,7 @@
this.TxtFromCode.BorderStyle = System.Windows.Forms.BorderStyle.None; this.TxtFromCode.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.TxtFromCode.DetectUrls = false; this.TxtFromCode.DetectUrls = false;
this.TxtFromCode.EmptyText = "请填写待转换的内容"; this.TxtFromCode.EmptyText = "请填写待转换的内容";
this.TxtFromCode.Font = new System.Drawing.Font("Courier New", 10F);
this.TxtFromCode.ForeColor = System.Drawing.Color.Black; this.TxtFromCode.ForeColor = System.Drawing.Color.Black;
this.TxtFromCode.Location = new System.Drawing.Point(12, 3); this.TxtFromCode.Location = new System.Drawing.Point(12, 3);
this.TxtFromCode.Name = "TxtFromCode"; this.TxtFromCode.Name = "TxtFromCode";
@ -98,34 +97,36 @@
this.TxtFromCode.Size = new System.Drawing.Size(812, 207); this.TxtFromCode.Size = new System.Drawing.Size(812, 207);
this.TxtFromCode.TabIndex = 31; this.TxtFromCode.TabIndex = 31;
this.TxtFromCode.Text = ""; this.TxtFromCode.Text = "";
this.TxtFromCode.WordWrap = false;
this.TxtFromCode.TextChanged += new System.EventHandler(this.TxtFromCode_TextChanged); this.TxtFromCode.TextChanged += new System.EventHandler(this.TxtFromCode_TextChanged);
this.TxtFromCode.DoubleClick += new System.EventHandler(this.TxtFromCode_DoubleClick); this.TxtFromCode.DoubleClick += new System.EventHandler(this.TxtFromCode_DoubleClick);
// //
// fastColoredTextBox1 // highlightEditor1
// //
this.fastColoredTextBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.highlightEditor1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.fastColoredTextBox1.AutoScrollMinSize = new System.Drawing.Size(27, 14); this.highlightEditor1.AutoCAutoHide = false;
this.fastColoredTextBox1.ContextMenuStrip = this.contextMenuStripHighlightText1; this.highlightEditor1.AutoCMaxHeight = 9;
this.fastColoredTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam; this.highlightEditor1.BiDirectionality = ScintillaNET.BiDirectionalDisplayType.Disabled;
this.fastColoredTextBox1.Font = new System.Drawing.Font("Courier New", 9.75F); this.highlightEditor1.CaretLineBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
this.fastColoredTextBox1.Location = new System.Drawing.Point(12, 238); this.highlightEditor1.CaretLineVisible = true;
this.fastColoredTextBox1.Name = "fastColoredTextBox1"; this.highlightEditor1.LexerName = null;
this.fastColoredTextBox1.Size = new System.Drawing.Size(812, 255); this.highlightEditor1.Location = new System.Drawing.Point(12, 238);
this.fastColoredTextBox1.TabIndex = 32; this.highlightEditor1.Name = "highlightEditor1";
// this.highlightEditor1.ScrollWidth = 88;
// contextMenuStripHighlightText1 this.highlightEditor1.Size = new System.Drawing.Size(812, 245);
// this.highlightEditor1.TabIndents = true;
this.contextMenuStripHighlightText1.Name = "contextMenuStripHighlightText1"; this.highlightEditor1.TabIndex = 32;
this.contextMenuStripHighlightText1.Size = new System.Drawing.Size(101, 186); this.highlightEditor1.UseRightToLeftReadingLayout = false;
this.highlightEditor1.WrapMode = ScintillaNET.WrapMode.None;
// //
// FrmStrToCode // FrmStrToCode
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(836, 495); this.ClientSize = new System.Drawing.Size(836, 495);
this.Controls.Add(this.fastColoredTextBox1); this.Controls.Add(this.highlightEditor1);
this.Controls.Add(this.TxtFromCode); this.Controls.Add(this.TxtFromCode);
this.Controls.Add(this.RbStrToASP); this.Controls.Add(this.RbStrToASP);
this.Controls.Add(this.RbStrToQuickJS); this.Controls.Add(this.RbStrToQuickJS);
@ -134,6 +135,7 @@
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FrmStrToCode"; this.Name = "FrmStrToCode";
this.Text = "字符串转代码"; this.Text = "字符串转代码";
this.Load += new System.EventHandler(this.FrmStrToCode_Load);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -146,7 +148,6 @@
private System.Windows.Forms.RadioButton RbStrToASP; private System.Windows.Forms.RadioButton RbStrToASP;
private ryPaiban.Model.MenuRight menuRight1; private ryPaiban.Model.MenuRight menuRight1;
private ryControls.Controls.RichTextBox2 TxtFromCode; private ryControls.Controls.RichTextBox2 TxtFromCode;
private FastColoredTextBoxNS.FastColoredTextBox fastColoredTextBox1; private ryControls.HighlightEditor highlightEditor1;
private ryProcessManager.hezuo.ContextMenuStripHighlightText contextMenuStripHighlightText1;
} }
} }

View File

@ -1,131 +1,91 @@
using FastColoredTextBoxNS; using System;
using System; using System.Collections.Generic;
using System.Collections.Generic; using System.ComponentModel;
using System.ComponentModel; using System.Data;
using System.Data; using System.Drawing;
using System.Drawing; using System.Linq;
using System.Linq; using System.Text;
using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Windows.Forms; using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking; using WeifenLuo.WinFormsUI.Docking;
namespace .Tools namespace .Tools
{ {
public partial class FrmStrToCode : DockContent public partial class FrmStrToCode : DockContent
{ {
public FrmStrToCode() public FrmStrToCode()
{ {
InitializeComponent(); InitializeComponent();
fastColoredTextBox1.ReadOnly = true; highlightEditor1.ReadOnly = true;
fastColoredTextBox1.ClearStylesBuffer(); }
fastColoredTextBox1.Range.ClearStyle(StyleIndex.All); private void Convert()
fastColoredTextBox1.AddStyle(new MarkerStyle(new SolidBrush(Color.FromArgb(40, Color.Gray)))); {
fastColoredTextBox1.AutoIndentNeeded -= fctb_AutoIndentNeeded; StringBuilder builder = new StringBuilder();
fastColoredTextBox1.Language = Language.JSON; var formart = "";
fastColoredTextBox1.OnSyntaxHighlight(new TextChangedEventArgs(fastColoredTextBox1.Range)); if (RbStrToC.Checked)
} {
private void fctb_AutoIndentNeeded(object sender, AutoIndentEventArgs args) builder.Append(" StringBuilder sb = new StringBuilder();\r\n");
{ builder.Append(" sb.Append(\"" + TxtFromCode.Text.Trim().Replace("\"", "\\\"").Replace("\r\n", "\n").Replace("\n", "\");\r\n sb.Append(\"") + "\");");
//block {} formart = "c#";
if (Regex.IsMatch(args.LineText, @"^[^""']*\{.*\}[^""']*$")) }
return; else if (RbStrToJS.Checked)
//start of block {} {
if (Regex.IsMatch(args.LineText, @"^[^""']*\{")) builder.Append("var sb=\"" + this.TxtFromCode.Text.Trim().Replace("\"", "\\\"").Replace("\r\n", "\n").Replace("\n", "\";\r\n sb=sb+\"") + "\";");
{ formart = "js";
args.ShiftNextLines = args.TabLength; }
return; else if (RbStrToQuickJS.Checked)
} {
//end of block {} builder.Append("var sb=\"" + this.TxtFromCode.Text.Trim().Replace("\"", "\\\"").Replace("\r\n", "\n").Replace("\n", "\";\r\n sb=sb+\"") + "\";");
if (Regex.IsMatch(args.LineText, @"}[^""']*$")) builder = new StringBuilder(builder.ToString().Replace("script", "scr\"+\"ipt") + " document.write(sb);");
{ builder.Insert(0, "<script>\r\n");
args.Shift = -args.TabLength; builder.Append ("\r\n</script>");
args.ShiftNextLines = -args.TabLength; formart = "html";
return; }
} else if (RbStrToASP.Checked)
//label {
if (Regex.IsMatch(args.LineText, @"^\s*\w+\s*:\s*($|//)") && builder.Append("sb=\"" + this.TxtFromCode.Text.Trim().Replace("\"", "\"\"").Replace("\r\n", "\n").Replace("\n", "\" & vbCrLf \r\nsb=sb & \"") + "\"");
!Regex.IsMatch(args.LineText, @"^\s*default\s*:")) formart = "vb";
{ }
args.Shift = -args.TabLength; highlightEditor1.SetHightlightText(builder.ToString(),formart);
return; }
}
//some statements: case, default private void RbStrToC_CheckedChanged(object sender, EventArgs e)
if (Regex.IsMatch(args.LineText, @"^\s*(case|default)\b.*:\s*($|//)")) {
{ Convert();
args.Shift = -args.TabLength / 2; }
return;
} private void RbStrToJS_CheckedChanged(object sender, EventArgs e)
//is unclosed operator in previous line ? {
if (Regex.IsMatch(args.PrevLineText, @"^\s*(if|for|foreach|while|[\}\s]*else)\b[^{]*$")) Convert();
if (!Regex.IsMatch(args.PrevLineText, @"(;\s*$)|(;\s*//)"))//operator is unclosed }
{
args.Shift = args.TabLength; private void RbStrToQuickJS_CheckedChanged(object sender, EventArgs e)
return; {
} Convert();
} }
private void Convert()
{ private void TxtFromCode_DoubleClick(object sender, EventArgs e)
StringBuilder builder = new StringBuilder(); {
if (RbStrToC.Checked) ryControls.Controls.RichTextBox2 txt = (ryControls.Controls.RichTextBox2)sender;
{ .Controls.FrmText frm = new Controls.FrmText
builder.Append(" StringBuilder sb = new StringBuilder();\r\n"); {
builder.Append(" sb.Append(\"" + TxtFromCode.Text.Trim().Replace("\"", "\\\"").Replace("\r\n", "\n").Replace("\n", "\");\r\n sb.Append(\"") + "\");"); Icon = Icon
fastColoredTextBox1.Language = FastColoredTextBoxNS.Language.CSharp; };
} frm.richTextBox1.Text = txt.Text;
else if (RbStrToJS.Checked) if (frm.ShowDialog() == DialogResult.OK)
{ {
builder.Append("var sb=\"" + this.TxtFromCode.Text.Trim().Replace("\"", "\\\"").Replace("\r\n", "\n").Replace("\n", "\";\r\n sb=sb+\"") + "\";"); txt.Text = frm.richTextBox1.Text;
fastColoredTextBox1.Language = FastColoredTextBoxNS.Language.JS; }
} }
else if (RbStrToQuickJS.Checked)
{ private void TxtFromCode_TextChanged(object sender, EventArgs e)
builder.Append("var sb=\"" + this.TxtFromCode.Text.Trim().Replace("\"", "\\\"").Replace("\r\n", "\n").Replace("\n", "\";\r\n sb=sb+\"") + "\";"); {
builder = new StringBuilder(builder.ToString().Replace("script", "scr\"+\"ipt") + " document.write(sb);"); Convert();
builder.Insert(0, "<script>\r\n"); }
builder.Append ("\r\n</script>");
fastColoredTextBox1.Language = FastColoredTextBoxNS.Language.HTML; private void FrmStrToCode_Load(object sender, EventArgs e)
} {
else if (RbStrToASP.Checked) highlightEditor1.SetFocus();
{ }
builder.Append("sb=\"" + this.TxtFromCode.Text.Trim().Replace("\"", "\"\"").Replace("\r\n", "\n").Replace("\n", "\" & vbCrLf \r\nsb=sb & \"") + "\""); }
fastColoredTextBox1.Language = FastColoredTextBoxNS.Language.VB; }
}
fastColoredTextBox1.Text = builder.ToString();
}
private void RbStrToC_CheckedChanged(object sender, EventArgs e)
{
Convert();
}
private void RbStrToJS_CheckedChanged(object sender, EventArgs e)
{
Convert();
}
private void RbStrToQuickJS_CheckedChanged(object sender, EventArgs e)
{
Convert();
}
private void TxtFromCode_DoubleClick(object sender, EventArgs e)
{
ryControls.Controls.RichTextBox2 txt = (ryControls.Controls.RichTextBox2)sender;
.Controls.FrmText frm = new Controls.FrmText
{
Icon = Icon
};
frm.richTextBox1.Text = txt.Text;
if (frm.ShowDialog() == DialogResult.OK)
{
txt.Text = frm.richTextBox1.Text;
}
}
private void TxtFromCode_TextChanged(object sender, EventArgs e)
{
Convert();
}
}
}

View File

@ -117,10 +117,6 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="contextMenuStripHighlightText1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>

View File

@ -30,14 +30,12 @@
{ {
this.components = new System.ComponentModel.Container(); this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmWebGet)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmWebGet));
this.ChkUrlLower = new System.Windows.Forms.CheckBox();
this.tabControl2 = new System.Windows.Forms.TabControl(); this.tabControl2 = new System.Windows.Forms.TabControl();
this.tabPage3 = new System.Windows.Forms.TabPage(); this.tabPage3 = new System.Windows.Forms.TabPage();
this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.RichHtml = new ryControls.Controls.RichTextBox2(); this.RichHtml = new ryControls.Controls.RichTextBox2();
this.tabPage12 = new System.Windows.Forms.TabPage(); this.tabPage12 = new System.Windows.Forms.TabPage();
this.Te_Format = new FastColoredTextBoxNS.FastColoredTextBox(); this.highlightEditor1 = new ryControls.HighlightEditor();
this.contextMenuStripHighlightText1 = new ryProcessManager.hezuo.ContextMenuStripHighlightText();
this.tabPage4 = new System.Windows.Forms.TabPage(); this.tabPage4 = new System.Windows.Forms.TabPage();
this.RichCookie = new ryControls.Controls.RichTextBox2(); this.RichCookie = new ryControls.Controls.RichTextBox2();
this.tabPage5 = new System.Windows.Forms.TabPage(); this.tabPage5 = new System.Windows.Forms.TabPage();
@ -74,22 +72,24 @@
this.label4 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label();
this.CbbEncoding = new ryControls.RyComboBox(); this.CbbEncoding = new ryControls.RyComboBox();
this.label3 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label();
this.BtnRunHtml = new ryControls.ButtonEx();
this.RbPost = new System.Windows.Forms.RadioButton(); this.RbPost = new System.Windows.Forms.RadioButton();
this.RbGet = new System.Windows.Forms.RadioButton(); this.RbGet = new System.Windows.Forms.RadioButton();
this.TxtUrl = new ryControls.TextBoxEx2();
this.label2 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label();
this.menuRight1 = new ryPaiban.Model.MenuRight(this.components);
this.BtnCtreateCShape = new ryControls.ButtonEx();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.objectListView2 = new BrightIdeasSoftware.ObjectListView();
this.OlvUrl = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.OlvName = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(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.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuRight1 = new ryPaiban.Model.MenuRight(this.components);
this.TxtUrl = new ryControls.TextBoxEx2();
this.BtnCtreateCShape = new ryControls.ButtonEx();
this.BtnRunHtml = new ryControls.ButtonEx();
this.objectListView2 = new BrightIdeasSoftware.ObjectListView();
this.OlvUrl = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.OlvName = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.BtnMore = new ryControls.SuperPictureBox();
this.MenuMore = new System.Windows.Forms.ContextMenuStrip(this.components);
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.tabControl2.SuspendLayout(); this.tabControl2.SuspendLayout();
this.tabPage3.SuspendLayout(); this.tabPage3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
@ -105,20 +105,11 @@
this.tabPage7.SuspendLayout(); this.tabPage7.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.objectListView2)).BeginInit();
this.contextMenuStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.objectListView2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.BtnMore)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// ChkUrlLower
//
this.ChkUrlLower.AutoSize = true;
this.ChkUrlLower.Location = new System.Drawing.Point(630, 10);
this.ChkUrlLower.Name = "ChkUrlLower";
this.ChkUrlLower.Size = new System.Drawing.Size(72, 16);
this.ChkUrlLower.TabIndex = 109;
this.ChkUrlLower.Text = "全转小写";
this.ChkUrlLower.UseVisualStyleBackColor = true;
//
// tabControl2 // tabControl2
// //
this.tabControl2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.tabControl2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@ -176,7 +167,7 @@
// //
// tabPage12 // tabPage12
// //
this.tabPage12.Controls.Add(this.Te_Format); this.tabPage12.Controls.Add(this.highlightEditor1);
this.tabPage12.Location = new System.Drawing.Point(4, 22); this.tabPage12.Location = new System.Drawing.Point(4, 22);
this.tabPage12.Name = "tabPage12"; this.tabPage12.Name = "tabPage12";
this.tabPage12.Padding = new System.Windows.Forms.Padding(3); this.tabPage12.Padding = new System.Windows.Forms.Padding(3);
@ -185,22 +176,26 @@
this.tabPage12.Text = "HTML格式化"; this.tabPage12.Text = "HTML格式化";
this.tabPage12.UseVisualStyleBackColor = true; this.tabPage12.UseVisualStyleBackColor = true;
// //
// Te_Format // highlightEditor1
// //
this.Te_Format.AutoScrollMinSize = new System.Drawing.Size(0, 17); this.highlightEditor1.AutoCAutoHide = false;
this.Te_Format.ContextMenuStrip = this.contextMenuStripHighlightText1; this.highlightEditor1.AutoCMaxHeight = 9;
this.Te_Format.Cursor = System.Windows.Forms.Cursors.IBeam; this.highlightEditor1.BiDirectionality = ScintillaNET.BiDirectionalDisplayType.Disabled;
this.Te_Format.Dock = System.Windows.Forms.DockStyle.Fill; this.highlightEditor1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.Te_Format.ImeMode = System.Windows.Forms.ImeMode.On; this.highlightEditor1.CaretLineBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
this.Te_Format.Location = new System.Drawing.Point(3, 3); this.highlightEditor1.CaretLineVisible = true;
this.Te_Format.Name = "Te_Format"; this.highlightEditor1.Dock = System.Windows.Forms.DockStyle.Fill;
this.Te_Format.Size = new System.Drawing.Size(875, 274); this.highlightEditor1.Font = new System.Drawing.Font("Consolas", 11.25F);
this.Te_Format.TabIndex = 24; this.highlightEditor1.LexerName = null;
// this.highlightEditor1.Location = new System.Drawing.Point(3, 3);
// contextMenuStripHighlightText1 this.highlightEditor1.Name = "highlightEditor1";
// this.highlightEditor1.ReadOnly = true;
this.contextMenuStripHighlightText1.Name = "contextMenuStripHighlightText1"; this.highlightEditor1.ScrollWidth = 1;
this.contextMenuStripHighlightText1.Size = new System.Drawing.Size(101, 186); this.highlightEditor1.Size = new System.Drawing.Size(875, 274);
this.highlightEditor1.TabIndents = true;
this.highlightEditor1.TabIndex = 0;
this.highlightEditor1.UseRightToLeftReadingLayout = false;
this.highlightEditor1.WrapMode = ScintillaNET.WrapMode.None;
// //
// tabPage4 // tabPage4
// //
@ -686,21 +681,10 @@
this.label3.TabIndex = 0; this.label3.TabIndex = 0;
this.label3.Text = "选择编码"; this.label3.Text = "选择编码";
// //
// BtnRunHtml
//
this.BtnRunHtml.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(76)))), ((int)(((byte)(95)))));
this.BtnRunHtml.Location = new System.Drawing.Point(723, 6);
this.BtnRunHtml.Name = "BtnRunHtml";
this.BtnRunHtml.Size = new System.Drawing.Size(82, 26);
this.BtnRunHtml.TabIndex = 104;
this.BtnRunHtml.Text = "执行";
this.BtnRunHtml.UseVisualStyleBackColor = true;
this.BtnRunHtml.Click += new System.EventHandler(this.BtnRunHtml_Click);
//
// RbPost // RbPost
// //
this.RbPost.AutoSize = true; this.RbPost.AutoSize = true;
this.RbPost.Location = new System.Drawing.Point(577, 10); this.RbPost.Location = new System.Drawing.Point(629, 10);
this.RbPost.Name = "RbPost"; this.RbPost.Name = "RbPost";
this.RbPost.Size = new System.Drawing.Size(47, 16); this.RbPost.Size = new System.Drawing.Size(47, 16);
this.RbPost.TabIndex = 103; this.RbPost.TabIndex = 103;
@ -711,7 +695,7 @@
// //
this.RbGet.AutoSize = true; this.RbGet.AutoSize = true;
this.RbGet.Checked = true; this.RbGet.Checked = true;
this.RbGet.Location = new System.Drawing.Point(530, 10); this.RbGet.Location = new System.Drawing.Point(582, 10);
this.RbGet.Name = "RbGet"; this.RbGet.Name = "RbGet";
this.RbGet.Size = new System.Drawing.Size(41, 16); this.RbGet.Size = new System.Drawing.Size(41, 16);
this.RbGet.TabIndex = 102; this.RbGet.TabIndex = 102;
@ -719,30 +703,6 @@
this.RbGet.Text = "Get"; this.RbGet.Text = "Get";
this.RbGet.UseVisualStyleBackColor = true; this.RbGet.UseVisualStyleBackColor = true;
// //
// TxtUrl
//
this.TxtUrl.BackColor = System.Drawing.Color.White;
this.TxtUrl.EmptyText = "请填写请求url";
this.TxtUrl.ImeMode = System.Windows.Forms.ImeMode.Close;
this.TxtUrl.Location = new System.Drawing.Point(45, 6);
this.TxtUrl.MaxLength = 999999999;
this.TxtUrl.Multiline = false;
this.TxtUrl.Name = "TxtUrl";
this.TxtUrl.OnlyNumeric = false;
this.TxtUrl.PasswordChar = '\0';
this.TxtUrl.ReadOnly = false;
this.TxtUrl.SelectedText = "";
this.TxtUrl.SelectionLength = 0;
this.TxtUrl.SelectionStart = 0;
this.TxtUrl.Size = new System.Drawing.Size(479, 23);
this.TxtUrl.TabIndex = 110;
this.TxtUrl.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.TxtUrl.ToolTip = "";
this.TxtUrl.WordWrap = true;
this.TxtUrl.TextChanged2 += new System.EventHandler(this.TxtUrl_TextChanged2);
this.TxtUrl.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TxtUrl_KeyDown);
this.TxtUrl.Leave += new System.EventHandler(this.TxtUrl_Leave);
//
// label2 // label2
// //
this.label2.AutoSize = true; this.label2.AutoSize = true;
@ -752,66 +712,6 @@
this.label2.TabIndex = 101; this.label2.TabIndex = 101;
this.label2.Text = "Url"; this.label2.Text = "Url";
// //
// menuRight1
//
this.menuRight1.Name = "menuRight1";
this.menuRight1.Size = new System.Drawing.Size(185, 92);
this.menuRight1.SourceContent = this;
//
// BtnCtreateCShape
//
this.BtnCtreateCShape.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(76)))), ((int)(((byte)(95)))));
this.BtnCtreateCShape.Location = new System.Drawing.Point(812, 6);
this.BtnCtreateCShape.Name = "BtnCtreateCShape";
this.BtnCtreateCShape.Size = new System.Drawing.Size(82, 26);
this.BtnCtreateCShape.TabIndex = 111;
this.BtnCtreateCShape.Text = "生成代码";
this.BtnCtreateCShape.UseVisualStyleBackColor = true;
this.BtnCtreateCShape.Click += new System.EventHandler(this.BtnCtreateCShape_Click);
//
// timer1
//
this.timer1.Interval = 1000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// objectListView2
//
this.objectListView2.AllColumns.Add(this.OlvUrl);
this.objectListView2.AllColumns.Add(this.OlvName);
this.objectListView2.CellEditUseWholeCell = false;
this.objectListView2.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.OlvUrl,
this.OlvName});
this.objectListView2.ContextMenuStrip = this.contextMenuStrip1;
this.objectListView2.Cursor = System.Windows.Forms.Cursors.Default;
this.objectListView2.FullRowSelect = true;
this.objectListView2.HideSelection = false;
this.objectListView2.Location = new System.Drawing.Point(45, 30);
this.objectListView2.MultiSelect = false;
this.objectListView2.Name = "objectListView2";
this.objectListView2.RowHeight = 25;
this.objectListView2.ShowGroups = false;
this.objectListView2.ShowItemToolTips = true;
this.objectListView2.Size = new System.Drawing.Size(653, 323);
this.objectListView2.TabIndex = 113;
this.objectListView2.UseCompatibleStateImageBehavior = false;
this.objectListView2.UseHotItem = true;
this.objectListView2.View = System.Windows.Forms.View.Details;
this.objectListView2.Visible = false;
this.objectListView2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Table1_KeyDown);
this.objectListView2.Leave += new System.EventHandler(this.Table1_Leave);
this.objectListView2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.table1_MouseClick);
//
// OlvUrl
//
this.OlvUrl.Text = "网址";
this.OlvUrl.Width = 430;
//
// OlvName
//
this.OlvName.Text = "名称";
this.OlvName.Width = 200;
//
// contextMenuStrip1 // contextMenuStrip1
// //
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -821,7 +721,7 @@
this.ToolStripMenuItem}); this.ToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1"; this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(149, 76); this.contextMenuStrip1.Size = new System.Drawing.Size(149, 76);
this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStrip1_Opening); this.contextMenuStrip1.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStrip1_Opening);
// //
// 置顶收藏该项ToolStripMenuItem // 置顶收藏该项ToolStripMenuItem
// //
@ -849,14 +749,123 @@
this.ToolStripMenuItem.Text = "设置备注"; this.ToolStripMenuItem.Text = "设置备注";
this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click); this.ToolStripMenuItem.Click += new System.EventHandler(this.ToolStripMenuItem_Click);
// //
// menuRight1
//
this.menuRight1.Name = "menuRight1";
this.menuRight1.Size = new System.Drawing.Size(185, 92);
this.menuRight1.SourceContent = null;
//
// TxtUrl
//
this.TxtUrl.BackColor = System.Drawing.Color.White;
this.TxtUrl.EmptyText = "请填写请求url";
this.TxtUrl.ImeMode = System.Windows.Forms.ImeMode.Close;
this.TxtUrl.Location = new System.Drawing.Point(45, 6);
this.TxtUrl.MaxLength = 999999999;
this.TxtUrl.Multiline = false;
this.TxtUrl.Name = "TxtUrl";
this.TxtUrl.OnlyNumeric = false;
this.TxtUrl.PasswordChar = '\0';
this.TxtUrl.ReadOnly = false;
this.TxtUrl.SelectedText = "";
this.TxtUrl.SelectionLength = 0;
this.TxtUrl.SelectionStart = 0;
this.TxtUrl.Size = new System.Drawing.Size(505, 23);
this.TxtUrl.TabIndex = 110;
this.TxtUrl.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.TxtUrl.ToolTip = "";
this.TxtUrl.WordWrap = true;
this.TxtUrl.TextChanged2 += new System.EventHandler(this.TxtUrl_TextChanged2);
this.TxtUrl.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TxtUrl_KeyDown);
this.TxtUrl.Leave += new System.EventHandler(this.TxtUrl_Leave);
//
// BtnCtreateCShape
//
this.BtnCtreateCShape.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(76)))), ((int)(((byte)(95)))));
this.BtnCtreateCShape.Location = new System.Drawing.Point(812, 6);
this.BtnCtreateCShape.Name = "BtnCtreateCShape";
this.BtnCtreateCShape.Size = new System.Drawing.Size(82, 26);
this.BtnCtreateCShape.TabIndex = 111;
this.BtnCtreateCShape.Text = "生成代码";
this.BtnCtreateCShape.UseVisualStyleBackColor = true;
this.BtnCtreateCShape.Click += new System.EventHandler(this.BtnCtreateCShape_Click);
//
// BtnRunHtml
//
this.BtnRunHtml.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(76)))), ((int)(((byte)(95)))));
this.BtnRunHtml.Location = new System.Drawing.Point(723, 6);
this.BtnRunHtml.Name = "BtnRunHtml";
this.BtnRunHtml.Size = new System.Drawing.Size(82, 26);
this.BtnRunHtml.TabIndex = 104;
this.BtnRunHtml.Text = "执行";
this.BtnRunHtml.UseVisualStyleBackColor = true;
this.BtnRunHtml.Click += new System.EventHandler(this.BtnRunHtml_Click);
//
// objectListView2
//
this.objectListView2.AllColumns.Add(this.OlvUrl);
this.objectListView2.AllColumns.Add(this.OlvName);
this.objectListView2.CellEditUseWholeCell = false;
this.objectListView2.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.OlvUrl,
this.OlvName});
this.objectListView2.ContextMenuStrip = this.contextMenuStrip1;
this.objectListView2.Cursor = System.Windows.Forms.Cursors.Default;
this.objectListView2.FullRowSelect = true;
this.objectListView2.HideSelection = false;
this.objectListView2.Location = new System.Drawing.Point(45, 30);
this.objectListView2.MultiSelect = false;
this.objectListView2.Name = "objectListView2";
this.objectListView2.RowHeight = 25;
this.objectListView2.ShowItemToolTips = true;
this.objectListView2.Size = new System.Drawing.Size(653, 323);
this.objectListView2.TabIndex = 113;
this.objectListView2.UseCompatibleStateImageBehavior = false;
this.objectListView2.UseHotItem = true;
this.objectListView2.View = System.Windows.Forms.View.Details;
this.objectListView2.Visible = false;
this.objectListView2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Table1_KeyDown);
this.objectListView2.Leave += new System.EventHandler(this.Table1_Leave);
this.objectListView2.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Table1_MouseClick);
//
// OlvUrl
//
this.OlvUrl.Text = "网址";
this.OlvUrl.Width = 430;
//
// OlvName
//
this.OlvName.Text = "名称";
this.OlvName.Width = 200;
//
// BtnMore
//
this.BtnMore.Cursor = System.Windows.Forms.Cursors.Hand;
this.BtnMore.Image = ((System.Drawing.Image)(resources.GetObject("BtnMore.Image")));
this.BtnMore.ImageDomain = null;
this.BtnMore.ImageResFolder = null;
this.BtnMore.Location = new System.Drawing.Point(556, 8);
this.BtnMore.Name = "BtnMore";
this.BtnMore.Size = new System.Drawing.Size(20, 18);
this.BtnMore.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.BtnMore.TabIndex = 114;
this.BtnMore.TabStop = false;
this.toolTip1.SetToolTip(this.BtnMore, "更多选项");
this.BtnMore.Click += new System.EventHandler(this.BtnMore_Click);
//
// MenuMore
//
this.MenuMore.Name = "MenuMore";
this.MenuMore.Size = new System.Drawing.Size(61, 4);
//
// FrmWebGet // FrmWebGet
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(909, 620); this.ClientSize = new System.Drawing.Size(909, 620);
this.Controls.Add(this.BtnMore);
this.Controls.Add(this.TxtUrl); this.Controls.Add(this.TxtUrl);
this.Controls.Add(this.BtnCtreateCShape); this.Controls.Add(this.BtnCtreateCShape);
this.Controls.Add(this.ChkUrlLower);
this.Controls.Add(this.tabControl2); this.Controls.Add(this.tabControl2);
this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox2);
@ -889,16 +898,15 @@
this.groupBox2.PerformLayout(); this.groupBox2.PerformLayout();
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout(); this.groupBox1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.objectListView2)).EndInit();
this.contextMenuStrip1.ResumeLayout(false); this.contextMenuStrip1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.objectListView2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.BtnMore)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }
#endregion #endregion
private System.Windows.Forms.CheckBox ChkUrlLower;
private System.Windows.Forms.TabControl tabControl2; private System.Windows.Forms.TabControl tabControl2;
private System.Windows.Forms.TabPage tabPage3; private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.PictureBox pictureBox1;
@ -930,10 +938,8 @@
private System.Windows.Forms.RadioButton RbGet; private System.Windows.Forms.RadioButton RbGet;
private ryControls.TextBoxEx2 TxtUrl; private ryControls.TextBoxEx2 TxtUrl;
private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label2;
private ryProcessManager.hezuo.ContextMenuStripHighlightText contextMenuStripHighlightText1;
private ryPaiban.Model.MenuRight menuRight1; private ryPaiban.Model.MenuRight menuRight1;
private ryControls.ButtonEx BtnCtreateCShape; private ryControls.ButtonEx BtnCtreateCShape;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.TabControl tabControl1; private System.Windows.Forms.TabControl tabControl1;
private System.Windows.Forms.TabPage tabPage1; private System.Windows.Forms.TabPage tabPage1;
private System.Windows.Forms.TabPage tabPage2; private System.Windows.Forms.TabPage tabPage2;
@ -945,7 +951,6 @@
private ExtendedWebBrowser2.ExtendedWebBrowser extendedWebBrowser1; private ExtendedWebBrowser2.ExtendedWebBrowser extendedWebBrowser1;
private System.Windows.Forms.CheckBox ChkHtmlPreview; private System.Windows.Forms.CheckBox ChkHtmlPreview;
private System.Windows.Forms.CheckBox ChkNoPreview; private System.Windows.Forms.CheckBox ChkNoPreview;
private FastColoredTextBoxNS.FastColoredTextBox Te_Format;
private BrightIdeasSoftware.ObjectListView objectListView2; private BrightIdeasSoftware.ObjectListView objectListView2;
private BrightIdeasSoftware.OLVColumn OlvUrl; private BrightIdeasSoftware.OLVColumn OlvUrl;
private BrightIdeasSoftware.OLVColumn OlvName; private BrightIdeasSoftware.OLVColumn OlvName;
@ -958,5 +963,9 @@
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1; private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem;
private ryControls.HighlightEditor highlightEditor1;
private ryControls.SuperPictureBox BtnMore;
private System.Windows.Forms.ContextMenuStrip MenuMore;
private System.Windows.Forms.ToolTip toolTip1;
} }
} }

View File

@ -1,16 +1,21 @@
using BrightIdeasSoftware; using BrightIdeasSoftware;
using DotNet4.Utilities; using DotNet4.Utilities;
using FastColoredTextBoxNS;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using ryCommon; using ryCommon;
using ryCommonDb; using ryCommonDb;
using ryControls;
using ryProcessManager.hezuo;
using ScintillaNET;
using Sheng.Winform.Controls.PopupControl; using Sheng.Winform.Controls.PopupControl;
using SuperDesign.Controls;
using SuperDesign.Tools;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
using System.Data; using System.Data;
using System.Drawing; using System.Drawing;
using System.Drawing.Design;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
@ -20,8 +25,10 @@ using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
using VPKSoft.ScintillaLexers;
using WeifenLuo.WinFormsUI.Docking; using WeifenLuo.WinFormsUI.Docking;
using .Manager; using .Manager;
using static ScintillaNET.Style;
namespace .Tools namespace .Tools
{ {
@ -32,12 +39,6 @@ namespace 开发辅助工具.Tools
InitializeComponent(); InitializeComponent();
LoadPram(); LoadPram();
tabControl2.SelectedTab = tabPage12; tabControl2.SelectedTab = tabPage12;
Te_Format.ClearStylesBuffer();
Te_Format.Range.ClearStyle(StyleIndex.All);
Te_Format.AddStyle(new MarkerStyle(new SolidBrush(Color.FromArgb(40, Color.Gray))));
Te_Format.AutoIndentNeeded -= fctb_AutoIndentNeeded;
Te_Format.Language = Language.JSON;
Te_Format.OnSyntaxHighlight(new TextChangedEventArgs(Te_Format.Range));
OlvUrl.AspectGetter = delegate (object x) { return ((UrlInfo)x).Url; }; OlvUrl.AspectGetter = delegate (object x) { return ((UrlInfo)x).Url; };
OlvName.AspectGetter = delegate (object x) { OlvName.AspectGetter = delegate (object x) {
var item = (UrlInfo)x; var item = (UrlInfo)x;
@ -50,29 +51,31 @@ namespace 开发辅助工具.Tools
}; };
//OlvUrl.Renderer = CreateDescribedTaskRenderer(); //OlvUrl.Renderer = CreateDescribedTaskRenderer();
objectListView2.FormatRow += ObjectListView2_FormatRow; objectListView2.FormatRow += ObjectListView2_FormatRow;
} }
private DescribedTaskRenderer CreateDescribedTaskRenderer() private DescribedTaskRenderer CreateDescribedTaskRenderer()
{ {
// Let's create an appropriately configured renderer. // Let's create an appropriately configured renderer.
DescribedTaskRenderer renderer = new DescribedTaskRenderer(); DescribedTaskRenderer renderer = new DescribedTaskRenderer
{
// Give the renderer its own collection of images.
// If this isn't set, the renderer will use the SmallImageList from the ObjectListView.
// (this is standard Renderer behaviour, not specific to DescribedTaskRenderer).
// Tell the renderer which property holds the text to be used as a description
DescriptionAspectName = "Name",
UseCustomCheckboxImages = false,
// Change the formatting slightly
TitleFont = new Font("宋体", 9, FontStyle.Regular),
DescriptionFont = new Font("宋体", 9),
DescriptionColor = Color.Gray,
TopSpace = 2,
//renderer.ImageTextSpace = 8;
TitleDescriptionSpace = 2,
// Give the renderer its own collection of images. // Use older Gdi renderering, since most people think the text looks clearer
// If this isn't set, the renderer will use the SmallImageList from the ObjectListView. UseGdiTextRendering = true
// (this is standard Renderer behaviour, not specific to DescribedTaskRenderer). };
// Tell the renderer which property holds the text to be used as a description
renderer.DescriptionAspectName = "Name";
renderer.UseCustomCheckboxImages = false;
// Change the formatting slightly
renderer.TitleFont = new Font("宋体", 9, FontStyle.Regular);
renderer.DescriptionFont = new Font("宋体", 9);
renderer.DescriptionColor = Color.Gray;
renderer.TopSpace = 2;
//renderer.ImageTextSpace = 8;
renderer.TitleDescriptionSpace = 2;
// Use older Gdi renderering, since most people think the text looks clearer
renderer.UseGdiTextRendering = true;
// If you like colours other than black and grey, you could uncomment these // If you like colours other than black and grey, you could uncomment these
// renderer.TitleColor = Color.DarkBlue; // renderer.TitleColor = Color.DarkBlue;
@ -86,48 +89,8 @@ namespace 开发辅助工具.Tools
if (item.Fav) { e.Item.ForeColor = Color.Blue; } else { e.Item.ForeColor = Color.Black; } if (item.Fav) { e.Item.ForeColor = Color.Blue; } else { e.Item.ForeColor = Color.Black; }
} }
private void fctb_AutoIndentNeeded(object sender, AutoIndentEventArgs args)
{
//block {}
if (Regex.IsMatch(args.LineText, @"^[^""']*\{.*\}[^""']*$"))
return;
//start of block {}
if (Regex.IsMatch(args.LineText, @"^[^""']*\{"))
{
args.ShiftNextLines = args.TabLength;
return;
}
//end of block {}
if (Regex.IsMatch(args.LineText, @"}[^""']*$"))
{
args.Shift = -args.TabLength;
args.ShiftNextLines = -args.TabLength;
return;
}
//label
if (Regex.IsMatch(args.LineText, @"^\s*\w+\s*:\s*($|//)") &&
!Regex.IsMatch(args.LineText, @"^\s*default\s*:"))
{
args.Shift = -args.TabLength;
return;
}
//some statements: case, default
if (Regex.IsMatch(args.LineText, @"^\s*(case|default)\b.*:\s*($|//)"))
{
args.Shift = -args.TabLength / 2;
return;
}
//is unclosed operator in previous line ?
if (Regex.IsMatch(args.PrevLineText, @"^\s*(if|for|foreach|while|[\}\s]*else)\b[^{]*$"))
if (!Regex.IsMatch(args.PrevLineText, @"(;\s*$)|(;\s*//)"))//operator is unclosed
{
args.Shift = args.TabLength;
return;
}
}
private void LoadPram() private void LoadPram()
{ {
Te_Format.ReadOnly = true;
CbbContentType.SelectedIndex = 0; CbbContentType.SelectedIndex = 0;
CbbUserAgent.SelectedIndex = 0; CbbUserAgent.SelectedIndex = 0;
CbbEncoding.SelectedIndex = 0; CbbEncoding.SelectedIndex = 0;
@ -168,8 +131,10 @@ namespace 开发辅助工具.Tools
}); });
TxtPost.AddMenu("插入时间戳", "").Click += new EventHandler((object sender2, EventArgs e2) => TxtPost.AddMenu("插入时间戳", "").Click += new EventHandler((object sender2, EventArgs e2) =>
{ {
SuperDesign.Controls.FrmInsertUnixTime frm = new SuperDesign.Controls.FrmInsertUnixTime(); SuperDesign.Controls.FrmInsertUnixTime frm = new SuperDesign.Controls.FrmInsertUnixTime
frm.Icon = Icon; {
Icon = Icon
};
var text = TxtPost.SelectedText; var text = TxtPost.SelectedText;
if(text.Length>4 && text.IsInt()) if(text.Length>4 && text.IsInt())
{ {
@ -199,6 +164,7 @@ namespace 开发辅助工具.Tools
Thread th; Thread th;
private void BtnRunHtml_Click(object sender, EventArgs e) private void BtnRunHtml_Click(object sender, EventArgs e)
{ {
objectListView2.Visible = false;
if (IsRunning) { if (IsRunning) {
IsExit = true; IsExit = true;
BtnRunHtml.Text = "停止中"; ; BtnRunHtml.Text = "停止中"; ;
@ -213,7 +179,7 @@ namespace 开发辅助工具.Tools
BtnRunHtml.Text = "停止执行"; ; BtnRunHtml.Text = "停止执行"; ;
#region #region
this.RichHtml.Text = "正在获取数据..."; this.RichHtml.Text = "正在获取数据...";
Te_Format.Text = "正在获取数据..."; highlightEditor1.Text="正在获取数据...";
this.RichCookie.Text = ""; this.RichCookie.Text = "";
RichHeader.Text = ""; RichHeader.Text = "";
RichStatus.Text = ""; RichStatus.Text = "";
@ -256,12 +222,11 @@ namespace 开发辅助工具.Tools
{ {
URL = TxtUrl.Text.Trim(), URL = TxtUrl.Text.Trim(),
Method = str, Method = str,
IsToLower = this.ChkUrlLower.Checked,
Cookie = this.TxtCookie.Text.Trim(), Cookie = this.TxtCookie.Text.Trim(),
Referer = this.CbbReferer.Text.Trim(), Referer = this.CbbReferer.Text.Trim(),
Postdata = PostData, Postdata = PostData,
Timeout = Convert.ToInt32(this.CbbTimeout.Text.Replace("秒", string.Empty).Trim()) * 0x3e8, Timeout = this.CbbTimeout.Text.Replace("秒", string.Empty).Trim().ToInt() * 0x3e8,
ReadWriteTimeout = Convert.ToInt32(this.CbbWriteTimeout.Text.Replace("秒", string.Empty).Trim()) * 0x3e8, ReadWriteTimeout = this.CbbWriteTimeout.Text.Replace("秒", string.Empty).Trim().ToInt() * 0x3e8,
UserAgent = this.CbbUserAgent.Text, UserAgent = this.CbbUserAgent.Text,
ContentType = this.CbbContentType.Text, ContentType = this.CbbContentType.Text,
Allowautoredirect = this.ChkJump.Checked, Allowautoredirect = this.ChkJump.Checked,
@ -288,7 +253,7 @@ namespace 开发辅助工具.Tools
catch (Exception exception) catch (Exception exception)
{ {
this.RichHtml.Text = exception.Message; this.RichHtml.Text = exception.Message;
Te_Format.Text = ""; highlightEditor1.Text = "";
tabControl2.SelectedIndex = 0; tabControl2.SelectedIndex = 0;
BtnRunHtml.Text = "执行"; BtnRunHtml.Text = "执行";
IsRunning = false; IsRunning = false;
@ -297,9 +262,9 @@ namespace 开发辅助工具.Tools
} }
if (CbbUserAgent.SelectedIndex != -1) if (CbbUserAgent.SelectedIndex != -1)
{ {
if (CbbUserAgent.SelectedItem is UserAgentInfo) if (CbbUserAgent.SelectedItem is UserAgentInfo info)
{ {
item.UserAgent = ((UserAgentInfo)CbbUserAgent.SelectedItem).useragent; item.UserAgent = info.useragent;
} }
} }
if (!string.IsNullOrEmpty(this.CbbIp.Text.Trim())) if (!string.IsNullOrEmpty(this.CbbIp.Text.Trim()))
@ -325,13 +290,13 @@ namespace 开发辅助工具.Tools
DateTime dt = DateTime.Now; DateTime dt = DateTime.Now;
var result = http.GetHtml(item); var result = http.GetHtml(item);
DateTime dt_end = DateTime.Now; DateTime dt_end = DateTime.Now;
_ = this.Invoke(new Action(() => this.Invoke(new Action(() =>
{ {
#region #region
if (result.Html.Length > 1024 * 1024 * 4) if (result.Html.Length > 1024 * 1024 * 4)
{ {
this.RichHtml.Text = "获取失败,您要获取的网页超过4MB暂时无法获取。"; this.RichHtml.Text = "获取失败,您要获取的网页超过4MB暂时无法获取。";
Te_Format.Text = "获取失败,您要获取的网页超过4MB暂时无法获取。"; highlightEditor1.Text = "获取失败,您要获取的网页超过4MB暂时无法获取。";
} }
else else
{ {
@ -363,8 +328,7 @@ namespace 开发辅助工具.Tools
this.RichHtml.Text = result.Html; this.RichHtml.Text = result.Html;
if (Manager.Json.IsJson(result.Html)) if (Manager.Json.IsJson(result.Html))
{ {
Te_Format.Language = Language.JSON; highlightEditor1.SetHightlightText(Manager.Json.ConvertJsonString(result.Html), "json");
Te_Format.Text = Manager.Json.ConvertJsonString(result.Html);
AddUrl("", TxtUrl.Text); AddUrl("", TxtUrl.Text);
} }
else else
@ -380,15 +344,17 @@ namespace 开发辅助工具.Tools
if (_html.Length > 0) { _html += "\r\n"; } if (_html.Length > 0) { _html += "\r\n"; }
_html += _format_html[i]; _html += _format_html[i];
} }
Te_Format.Language = Language.HTML; //try
try //{
{ // var html2 = JJCCX.Xml.HtmlFormater.ConvertToXml(_html, true);
Te_Format.Text = JJCCX.Xml.HtmlFormater.ConvertToXml(_html, true); // scintilla1.Text = html2;
} //}
catch //catch(Exception ex)
{ //{
Te_Format.Text = _html; // scintilla1.Text = _html;
} //}
IndentLibrary.HtmlIndent indent = new IndentLibrary.HtmlIndent();
highlightEditor1.SetHightlightText(indent.Beautify(_html).Trim(),"html");
if (result.StatusCode == System.Net.HttpStatusCode.Redirect || result.StatusCode == System.Net.HttpStatusCode.OK) if (result.StatusCode == System.Net.HttpStatusCode.Redirect || result.StatusCode == System.Net.HttpStatusCode.OK)
{ {
string title = ""; string title = "";
@ -433,7 +399,7 @@ namespace 开发辅助工具.Tools
{ {
extendedWebBrowser1.LoadStrings(RichHtml.Text.Trim(), Encoding.GetEncoding(this.CbbEncoding.Text.Trim())); extendedWebBrowser1.LoadStrings(RichHtml.Text.Trim(), Encoding.GetEncoding(this.CbbEncoding.Text.Trim()));
} }
else { extendedWebBrowser1.LoadStrings(RichHtml.Text.Trim(), Encoding.UTF8); } else { extendedWebBrowser1.LoadStrings(RichHtml.Text.Trim()); }
//MessageBox.Show(extendedWebBrowser1.Document.Encoding); //MessageBox.Show(extendedWebBrowser1.Document.Encoding);
//extendedWebBrowser1.Document.Encoding = Encoding.UTF8.BodyName; //extendedWebBrowser1.Document.Encoding = Encoding.UTF8.BodyName;
} }
@ -471,7 +437,7 @@ namespace 开发辅助工具.Tools
{ {
this.RichHtml.Text = exception.Message; this.RichHtml.Text = exception.Message;
} }
Te_Format.Text = ""; highlightEditor1.Text = "";
})); }));
} }
this.Invoke(new Action(() => this.Invoke(new Action(() =>
@ -507,10 +473,12 @@ namespace 开发辅助工具.Tools
} }
private void FrmWebGet_Load(object sender, EventArgs e) private void FrmWebGet_Load(object sender, EventArgs e)
{ {
highlightEditor1.SetFocus();
//TxtPost.AutoWordSelection = false; //TxtPost.AutoWordSelection = false;
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; //加上这一句 System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; //加上这一句
contextMenuStripHighlightText1.AddSeparatorMenu(); var highlight_menu = (ContextMenuStripHighlightText2)highlightEditor1.ContextMenuStrip;
contextMenuStripHighlightText1.AddMenu("将选中的内容作为Json分析", "").Click += AnalyJson_Click; highlight_menu.AddSeparatorMenu();
highlight_menu.AddMenu("将选中的内容作为Json分析", "").Click += AnalyJson_Click;
for (int i = 0; i < this.Controls.Count; i++) for (int i = 0; i < this.Controls.Count; i++)
{ {
switch (this.Controls[i]) switch (this.Controls[i])
@ -543,7 +511,7 @@ namespace 开发辅助工具.Tools
ContextMenuStrip menu =(ContextMenuStrip) (((ToolStripMenuItem)sender).Owner); ContextMenuStrip menu =(ContextMenuStrip) (((ToolStripMenuItem)sender).Owner);
switch(menu.SourceControl) switch(menu.SourceControl)
{ {
case FastColoredTextBox rich_txt: case HighlightEditor rich_txt:
var SelectedText= rich_txt.SelectedText; var SelectedText= rich_txt.SelectedText;
if (SelectedText == "") { SelectedText = rich_txt.Text; } if (SelectedText == "") { SelectedText = rich_txt.Text; }
//if (Manager.Json.IsJson(SelectedText)) //if (Manager.Json.IsJson(SelectedText))
@ -581,7 +549,6 @@ namespace 开发辅助工具.Tools
{ {
URL = TxtUrl.Text.Trim(), URL = TxtUrl.Text.Trim(),
Method = str, Method = str,
IsToLower = this.ChkUrlLower.Checked,
Cookie = this.TxtCookie.Text.Trim(), Cookie = this.TxtCookie.Text.Trim(),
Referer = this.CbbReferer.Text.Trim(), Referer = this.CbbReferer.Text.Trim(),
Postdata = this.TxtPost.Text.Trim(), Postdata = this.TxtPost.Text.Trim(),
@ -594,9 +561,9 @@ namespace 开发辅助工具.Tools
}; };
if (CbbUserAgent.SelectedIndex != -1) if (CbbUserAgent.SelectedIndex != -1)
{ {
if (CbbUserAgent.SelectedItem is UserAgentInfo) if (CbbUserAgent.SelectedItem is UserAgentInfo info2)
{ {
item.UserAgent = ((UserAgentInfo)CbbUserAgent.SelectedItem).useragent; item.UserAgent = info2.useragent;
} }
} }
if (!string.IsNullOrEmpty(this.CbbIp.Text.Trim())) if (!string.IsNullOrEmpty(this.CbbIp.Text.Trim()))
@ -620,7 +587,6 @@ namespace 开发辅助工具.Tools
builder.Append(" Encoding = System.Text.Encoding.GetEncoding( \"" + this.CbbEncoding.Text.Trim() + "\"),//URL 可选项 默认为Get \r\n"); builder.Append(" Encoding = System.Text.Encoding.GetEncoding( \"" + this.CbbEncoding.Text.Trim() + "\"),//URL 可选项 默认为Get \r\n");
} }
builder.Append(" Method = \"" + item.Method + "\",//URL 可选项 默认为Get \r\n"); builder.Append(" Method = \"" + item.Method + "\",//URL 可选项 默认为Get \r\n");
builder.Append(" IsToLower = " + item.IsToLower.ToString().ToLower() + ",//得到的HTML代码是否转成小写 可选项默认转小写 \r\n");
builder.Append(" Cookie = \"" + item.Cookie + "\",//字符串Cookie 可选项 \r\n"); builder.Append(" Cookie = \"" + item.Cookie + "\",//字符串Cookie 可选项 \r\n");
builder.Append(" Referer =\"" + item.Referer + "\",//来源URL 可选项 \r\n"); builder.Append(" Referer =\"" + item.Referer + "\",//来源URL 可选项 \r\n");
builder.Append(" Postdata = \"" + item.Postdata + "\",//Post数据 可选项GET时不需要写 \r\n"); builder.Append(" Postdata = \"" + item.Postdata + "\",//Post数据 可选项GET时不需要写 \r\n");
@ -652,8 +618,7 @@ namespace 开发辅助工具.Tools
builder.Append(" return Bitmap.FromStream(ms,true);\r\n"); builder.Append(" return Bitmap.FromStream(ms,true);\r\n");
builder.Append(" }\r\n"); builder.Append(" }\r\n");
RichHtml.Text = builder.ToString(); RichHtml.Text = builder.ToString();
Te_Format.Language = Language.CSharp; highlightEditor1.SetHightlightText(builder.ToString(), "c#");
Te_Format.Text= builder.ToString();
} }
public void AddUrl(string title,string url) public void AddUrl(string title,string url)
@ -781,7 +746,6 @@ namespace 开发辅助工具.Tools
#region #region
objectListView2.ClearObjects(); objectListView2.ClearObjects();
List<UrlInfo> list = new List<UrlInfo>(); List<UrlInfo> list = new List<UrlInfo>();
DataProvider mydb = new DataProvider();
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType); IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1) if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{ {
@ -838,13 +802,7 @@ namespace 开发辅助工具.Tools
objectListView2.Visible = false; objectListView2.Visible = false;
} }
} }
private void Table1_MouseClick(object sender, MouseEventArgs e)
private void timer1_Tick(object sender, EventArgs e)
{
}
private void table1_MouseClick(object sender, MouseEventArgs e)
{ {
if (e.Button == MouseButtons.Left) if (e.Button == MouseButtons.Left)
{ {
@ -906,7 +864,7 @@ namespace 开发辅助工具.Tools
} }
private void contextMenuStrip1_Opening(object sender, CancelEventArgs e) private void ContextMenuStrip1_Opening(object sender, CancelEventArgs e)
{ {
var item = (UrlInfo)objectListView2.SelectedObject; var item = (UrlInfo)objectListView2.SelectedObject;
if (item == null) { return; } if (item == null) { return; }
@ -954,6 +912,104 @@ namespace 开发辅助工具.Tools
} }
db.Free(); db.Free();
} }
private void BtnMore_Click(object sender, EventArgs e)
{
SuperPictureBox btn = (SuperPictureBox)sender;
Point p = new Point(0, btn.Height);
MenuMore.Items.Clear();
AddMenu("API编辑器", "api");
AddMenu("-", "");
try
{
var uri = new Uri(TxtUrl.Text);
var host = uri.Host.ToLower();
if(host.IndexOfEx("www.87g")==0 || host.IndexOfEx("www.3h3") == 0
||host.IndexOfEx("www.downxia") == 0 || host.IndexOfEx("www.downbank") == 0)
{
List<MenuTag> list = new List<MenuTag>
{
new MenuTag() { Title = "切换到【87G】87g.com", Site = "http://www.87g.com" },
new MenuTag() { Title = "切换到【87G】87g.cn", Site = "http://www.87g.cn" },
new MenuTag() { Title = "-", Site = "" },
new MenuTag() { Title = "切换到【当游】3h3.com", Site = "http://www.3h3.com" },
new MenuTag() { Title = "切换到【当游】3h3.cn", Site = "http://www.3h3.cn" },
new MenuTag() { Title = "-", Site = "" },
new MenuTag() { Title = "切换到【当下】downxia.com", Site = "http://www.downxia.com" },
new MenuTag() { Title = "切换到【当下】downxia.cn", Site = "http://www.downxia.cn" },
new MenuTag() { Title = "-", Site = "" },
new MenuTag() { Title = "切换到【下银网】downbank.cn", Site = "https://www.downbank.cn" },
new MenuTag() { Title = "切换到【下银网】downbank.cc", Site = "http://www.downbank.cc" }
};
for (int i = 0; i < list.Count; i++)
{
if (list[i].Title=="-")
{
MenuMore.Items.Add(list[i].Title);
continue;
}
if (list[i].Site.IndexOfEx(host)>=0)
{continue;}
AddMenu(list[i].Title, list[i].Site);
}
}
}
catch { }
MenuMore.Show(btn, p);
void AddMenu(string title, string site)
{
ToolStripItem item = MenuMore.Items.Add(title);
item.Tag= new MenuTag() { Site = site };
item.Click += Item_Click;
}
}
private void Item_Click(object sender, EventArgs e)
{
if(sender is ToolStripItem item)
{
if(item.Tag is MenuTag menuTag)
{
if(menuTag.Site=="api")
{
Uri uri = null;
try
{
uri = new Uri(TxtUrl.Text);
}
catch { }
if (uri != null)
{
APIEditor frm = new APIEditor();
frm.LoadData(uri, TxtPost.Text);
if(frm.ShowDialog()==DialogResult.OK)
{
TxtPost.Text = frm.SelectedPostDatas;
}
frm.Dispose();
}
return;
}
var url = TxtUrl.Text;
var pos = url.IndexOfEx("//");
if(pos>=0)
{
pos = url.IndexOfEx("/", pos + 2);
if(pos>0)
{
TxtUrl.Text= menuTag.Site+ url.Substring(pos);
}
}
}
}
}
class MenuTag
{
public string Title { get; set; }
public string Site { get; set; }
}
} }
public class UrlInfo public class UrlInfo
{ {

View File

@ -117,16 +117,33 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="contextMenuStripHighlightText1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>33, 18</value> <value>141, 17</value>
</metadata> </metadata>
<metadata name="menuRight1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="menuRight1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>603, 26</value> <value>17, 17</value>
</metadata>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>388, 26</value>
</metadata> </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="BtnMore.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAfJJREFUWEe9
VU1LxDAQ7dVf4GUvy+ZrFQWxTVwEEcGDIHgQj4InD/4JURQEUURRFARBUPQXeRAEwYMgeBAED4JO6my6
29Zs2m32wUAzL8m8adK+QGO00SKETDbigWfU62qYczVeq7WG4gQhaoQz+aODMbkZJz1B0HA5qRVtxEnd
eTvpUwR0vcSo/E7qqFWkgkAX9SlCULkI+34lNdQdUgl8iWAsXOBUfpq9ubxBKouqRTSpmod9Pjr2vEbq
f1QlAjqdg/XvyT7qCqne6FdEk0YzsO6tY49LpNxRVgTn4TTc9tdkXXSBVHEUFUHplIJ5L2YNlWdIlYer
CDjzEOK5Y94JUv2jlwhCwgnIP5k5VB0hVR3+EyFEawyeH9t5weRBvMAH8kTAX+3B5Hi0j1OLQZBwVgcO
rUiLMEHlHk6xQpufoNEaDvUrlKy9iWDRFqatyHkTu0hZAZd0xdSiaj1Opt0QJu3ERA8YEVRtY8qKzuI6
rG7o+jr1Ony0Il3cyQ1LX6gUMsWLuCF8UodIlUK283JueIxUIeSceXk3hDM7RcoJOZ3374aw6TlSVmQ7
r9ANIaydZDr344b5Z5nt3KMbQnTd5mzng3HDW51PFx+oG0Lcd40r+nlZkSPiLxx/35Ug5zic3LBSGBGO
bugFWgQ+lkQQ/AJUtHba3NGRcAAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>423, 17</value>
</metadata>
<metadata name="MenuMore.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>306, 17</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAAAAAAAAAAAAAAAAAAAA AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAAAAAAAAAAAAAAAAAAAA
@ -203,7 +220,4 @@
AB8AAAA/AAAAfwYMAP8AAAH/AAAD/wAAA/8= AB8AAAA/AAAAfwYMAP8AAAH/AAAD/wAAA/8=
</value> </value>
</data> </data>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>280, 15</value>
</metadata>
</root> </root>

View File

@ -33,12 +33,11 @@
this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.TxtXML = new ryControls.Controls.RichTextBox2(); this.TxtXML = new ryControls.Controls.RichTextBox2();
this.panelEx1 = new ryControls.PanelEx(); this.panelEx1 = new ryControls.PanelEx();
this.fastColoredTextBox1 = new FastColoredTextBoxNS.FastColoredTextBox();
this.contextMenuStripHighlightText1 = new ryProcessManager.hezuo.ContextMenuStripHighlightText();
this.RySearchXpath = new ryControls.rySearch(); this.RySearchXpath = new ryControls.rySearch();
this.label1 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label();
this.CbbXMLType = new ryControls.RyComboBox(); this.CbbXMLType = new ryControls.RyComboBox();
this.menuRight1 = new ryPaiban.Model.MenuRight(this.components); this.menuRight1 = new ryPaiban.Model.MenuRight(this.components);
this.highlightEditor1 = new ryControls.HighlightEditor();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout();
@ -92,33 +91,15 @@
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.panelEx1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(216)))), ((int)(((byte)(223))))); this.panelEx1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(213)))), ((int)(((byte)(216)))), ((int)(((byte)(223)))));
this.panelEx1.Controls.Add(this.fastColoredTextBox1); this.panelEx1.Controls.Add(this.highlightEditor1);
this.panelEx1.Location = new System.Drawing.Point(2, 3); this.panelEx1.Location = new System.Drawing.Point(2, 3);
this.panelEx1.Name = "panelEx1"; this.panelEx1.Name = "panelEx1";
this.panelEx1.Padding = new System.Windows.Forms.Padding(2); this.panelEx1.Padding = new System.Windows.Forms.Padding(2);
this.panelEx1.RoundeStyle = ryControls.RoundStyle.None; this.panelEx1.RoundeStyle = ryControls.RoundStyle.None;
this.panelEx1.Size = new System.Drawing.Size(869, 326); this.panelEx1.Size = new System.Drawing.Size(869, 328);
this.panelEx1.TabIndex = 8; this.panelEx1.TabIndex = 8;
this.panelEx1.TileBackColor = System.Drawing.Color.White; this.panelEx1.TileBackColor = System.Drawing.Color.White;
// //
// fastColoredTextBox1
//
this.fastColoredTextBox1.AutoScrollMinSize = new System.Drawing.Size(0, 14);
this.fastColoredTextBox1.ContextMenuStrip = this.contextMenuStripHighlightText1;
this.fastColoredTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam;
this.fastColoredTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.fastColoredTextBox1.Font = new System.Drawing.Font("Courier New", 9.75F);
this.fastColoredTextBox1.ImeMode = System.Windows.Forms.ImeMode.On;
this.fastColoredTextBox1.Location = new System.Drawing.Point(2, 2);
this.fastColoredTextBox1.Name = "fastColoredTextBox1";
this.fastColoredTextBox1.Size = new System.Drawing.Size(865, 322);
this.fastColoredTextBox1.TabIndex = 0;
//
// contextMenuStripHighlightText1
//
this.contextMenuStripHighlightText1.Name = "contextMenuStripHighlightText1";
this.contextMenuStripHighlightText1.Size = new System.Drawing.Size(101, 186);
//
// RySearchXpath // RySearchXpath
// //
this.RySearchXpath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.RySearchXpath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
@ -165,6 +146,23 @@
this.menuRight1.Size = new System.Drawing.Size(185, 92); this.menuRight1.Size = new System.Drawing.Size(185, 92);
this.menuRight1.SourceContent = this; this.menuRight1.SourceContent = this;
// //
// highlightEditor1
//
this.highlightEditor1.AutoCMaxHeight = 9;
this.highlightEditor1.BiDirectionality = ScintillaNET.BiDirectionalDisplayType.Disabled;
this.highlightEditor1.CaretLineBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
this.highlightEditor1.CaretLineVisible = true;
this.highlightEditor1.Dock = System.Windows.Forms.DockStyle.Fill;
this.highlightEditor1.LexerName = null;
this.highlightEditor1.Location = new System.Drawing.Point(2, 2);
this.highlightEditor1.Name = "highlightEditor1";
this.highlightEditor1.ScrollWidth = 88;
this.highlightEditor1.Size = new System.Drawing.Size(865, 324);
this.highlightEditor1.TabIndents = true;
this.highlightEditor1.TabIndex = 0;
this.highlightEditor1.UseRightToLeftReadingLayout = false;
this.highlightEditor1.WrapMode = ScintillaNET.WrapMode.None;
//
// FrmXpath // FrmXpath
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@ -196,9 +194,8 @@
private ryControls.rySearch RySearchXpath; private ryControls.rySearch RySearchXpath;
private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label1;
private ryControls.RyComboBox CbbXMLType; private ryControls.RyComboBox CbbXMLType;
private ryProcessManager.hezuo.ContextMenuStripHighlightText contextMenuStripHighlightText1;
private ryPaiban.Model.MenuRight menuRight1; private ryPaiban.Model.MenuRight menuRight1;
private ryControls.Controls.RichTextBox2 TxtXML; private ryControls.Controls.RichTextBox2 TxtXML;
private FastColoredTextBoxNS.FastColoredTextBox fastColoredTextBox1; private ryControls.HighlightEditor highlightEditor1;
} }
} }

View File

@ -1,5 +1,4 @@
using FastColoredTextBoxNS; using HtmlAgilityPack;
using HtmlAgilityPack;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
@ -21,62 +20,18 @@ namespace 开发辅助工具.Tools
{ {
InitializeComponent(); InitializeComponent();
CbbXMLType.SelectedIndex = 0; CbbXMLType.SelectedIndex = 0;
fastColoredTextBox1.ReadOnly = true; highlightEditor1.ReadOnly = true;
fastColoredTextBox1.ClearStylesBuffer();
fastColoredTextBox1.Range.ClearStyle(StyleIndex.All);
fastColoredTextBox1.AddStyle(new MarkerStyle(new SolidBrush(Color.FromArgb(40, Color.Gray))));
fastColoredTextBox1.AutoIndentNeeded -= fctb_AutoIndentNeeded;
fastColoredTextBox1.Language = Language.JSON;
fastColoredTextBox1.OnSyntaxHighlight(new TextChangedEventArgs(fastColoredTextBox1.Range));
}
private void fctb_AutoIndentNeeded(object sender, AutoIndentEventArgs args)
{
//block {}
if (Regex.IsMatch(args.LineText, @"^[^""']*\{.*\}[^""']*$"))
return;
//start of block {}
if (Regex.IsMatch(args.LineText, @"^[^""']*\{"))
{
args.ShiftNextLines = args.TabLength;
return;
}
//end of block {}
if (Regex.IsMatch(args.LineText, @"}[^""']*$"))
{
args.Shift = -args.TabLength;
args.ShiftNextLines = -args.TabLength;
return;
}
//label
if (Regex.IsMatch(args.LineText, @"^\s*\w+\s*:\s*($|//)") &&
!Regex.IsMatch(args.LineText, @"^\s*default\s*:"))
{
args.Shift = -args.TabLength;
return;
}
//some statements: case, default
if (Regex.IsMatch(args.LineText, @"^\s*(case|default)\b.*:\s*($|//)"))
{
args.Shift = -args.TabLength / 2;
return;
}
//is unclosed operator in previous line ?
if (Regex.IsMatch(args.PrevLineText, @"^\s*(if|for|foreach|while|[\}\s]*else)\b[^{]*$"))
if (!Regex.IsMatch(args.PrevLineText, @"(;\s*$)|(;\s*//)"))//operator is unclosed
{
args.Shift = args.TabLength;
return;
}
} }
private void RySearchXpath_OnSearch(object sender, EventArgs e) private void RySearchXpath_OnSearch(object sender, EventArgs e)
{ {
string text = ""; string text = "";
var format = "";
try try
{ {
if (CbbXMLType.SelectedIndex == 0) if (CbbXMLType.SelectedIndex == 0)
{ {
fastColoredTextBox1.Language = Language.XML; format="xml";
System.Xml.XmlDocument xml = new System.Xml.XmlDocument(); System.Xml.XmlDocument xml = new System.Xml.XmlDocument();
xml.LoadXml(TxtXML.Text); xml.LoadXml(TxtXML.Text);
var node = xml.SelectNodes(RySearchXpath.Text); var node = xml.SelectNodes(RySearchXpath.Text);
@ -91,7 +46,7 @@ namespace 开发辅助工具.Tools
} }
else if (CbbXMLType.SelectedIndex == 1) else if (CbbXMLType.SelectedIndex == 1)
{ {
fastColoredTextBox1.Language = Language.HTML; format = "html";
HtmlAgilityPack.HtmlDocument htmlDoc = new HtmlAgilityPack.HtmlDocument(); HtmlAgilityPack.HtmlDocument htmlDoc = new HtmlAgilityPack.HtmlDocument();
htmlDoc.LoadHtml(TxtXML.Text); htmlDoc.LoadHtml(TxtXML.Text);
HtmlNodeCollection anchors = htmlDoc.DocumentNode.SelectNodes(RySearchXpath.Text); HtmlNodeCollection anchors = htmlDoc.DocumentNode.SelectNodes(RySearchXpath.Text);
@ -106,7 +61,7 @@ namespace 开发辅助工具.Tools
} }
else if (CbbXMLType.SelectedIndex == 2) else if (CbbXMLType.SelectedIndex == 2)
{ {
fastColoredTextBox1.Language = Language.JSON; format = "json";
try try
{ {
JObject jo = (JObject)JsonConvert.DeserializeObject(TxtXML.Text); JObject jo = (JObject)JsonConvert.DeserializeObject(TxtXML.Text);
@ -126,12 +81,12 @@ namespace 开发辅助工具.Tools
{ {
MessageBox.Show(ex.Message, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBox.Show(ex.Message, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
fastColoredTextBox1.Text = text; highlightEditor1.SetHightlightText(text,format);
} }
private void FrmXpath_Load(object sender, EventArgs e) private void FrmXpath_Load(object sender, EventArgs e)
{ {
highlightEditor1.SetFocus();
} }
private void TxtXML_DoubleClick(object sender, EventArgs e) private void TxtXML_DoubleClick(object sender, EventArgs e)

View File

@ -117,9 +117,6 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="contextMenuStripHighlightText1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="menuRight1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="menuRight1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>262, 17</value> <value>262, 17</value>
</metadata> </metadata>