### 2023-01-21更新
------ #### SuperDesign V2.0.2301.2101 - *.[新增]新增API编辑器,自动保存和快速插入修改参数。 - *.[改进]使用新款高亮编辑器。
This commit is contained in:
1 parent
dca2bd3d1c
commit
c7b33920bd
49 files changed
+4529
-1658
No files matched your search
@@ -18,7 +18,17 @@ namespace 开发辅助工具.Tools
|
||||
{
|
||||
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)
|
||||
{
|
||||
Color color = superColor1.BackColor;
|
||||
@@ -30,6 +40,7 @@ namespace 开发辅助工具.Tools
|
||||
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("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("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);
|
||||
|
||||
+68
-27
@@ -37,7 +37,6 @@
|
||||
this.RbURLEncode = new System.Windows.Forms.RadioButton();
|
||||
this.RbBase64Decode = 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.RbChsToUTF8 = new System.Windows.Forms.RadioButton();
|
||||
this.RbUTF8ToChs = new System.Windows.Forms.RadioButton();
|
||||
@@ -47,6 +46,10 @@
|
||||
this.RbSHA224 = new System.Windows.Forms.RadioButton();
|
||||
this.RbSHA512 = new System.Windows.Forms.RadioButton();
|
||||
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();
|
||||
//
|
||||
// RbChsToUnicode
|
||||
@@ -136,29 +139,6 @@
|
||||
this.RbBase64Encode.UseVisualStyleBackColor = true;
|
||||
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
|
||||
//
|
||||
this.menuRight1.Name = "menuRight1";
|
||||
@@ -250,6 +230,7 @@
|
||||
this.TxtFromCode.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.TxtFromCode.DetectUrls = false;
|
||||
this.TxtFromCode.EmptyText = "请填写待转换的内容";
|
||||
this.TxtFromCode.Font = new System.Drawing.Font("Courier New", 10F);
|
||||
this.TxtFromCode.ForeColor = System.Drawing.Color.Black;
|
||||
this.TxtFromCode.Location = new System.Drawing.Point(12, 54);
|
||||
this.TxtFromCode.Name = "TxtFromCode";
|
||||
@@ -257,14 +238,72 @@
|
||||
this.TxtFromCode.Size = new System.Drawing.Size(926, 174);
|
||||
this.TxtFromCode.TabIndex = 29;
|
||||
this.TxtFromCode.Text = "";
|
||||
this.TxtFromCode.WordWrap = false;
|
||||
this.TxtFromCode.TextChanged += new System.EventHandler(this.TxtFromCode_TextChanged);
|
||||
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
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
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.RbSHA512);
|
||||
this.Controls.Add(this.RbSHA224);
|
||||
@@ -280,7 +319,6 @@
|
||||
this.Controls.Add(this.RbURLEncode);
|
||||
this.Controls.Add(this.RbBase64Decode);
|
||||
this.Controls.Add(this.RbBase64Encode);
|
||||
this.Controls.Add(this.TxtResultCode);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "FrmEncode";
|
||||
this.TabPageContextMenuStrip = this.menuRight1;
|
||||
@@ -299,7 +337,6 @@
|
||||
private System.Windows.Forms.RadioButton RbURLEncode;
|
||||
private System.Windows.Forms.RadioButton RbBase64Decode;
|
||||
private System.Windows.Forms.RadioButton RbBase64Encode;
|
||||
private ryControls.TextBoxEx2 TxtResultCode;
|
||||
private ryPaiban.Model.MenuRight menuRight1;
|
||||
private System.Windows.Forms.RadioButton RbChsToUTF8;
|
||||
private System.Windows.Forms.RadioButton RbUTF8ToChs;
|
||||
@@ -308,6 +345,10 @@
|
||||
private System.Windows.Forms.RadioButton RbSHA256;
|
||||
private System.Windows.Forms.RadioButton RbSHA224;
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,16 @@
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using WeifenLuo.WinFormsUI.Docking;
|
||||
|
||||
namespace 开发辅助工具.Tools
|
||||
@@ -128,6 +131,26 @@ namespace 开发辅助工具.Tools
|
||||
catch { TxtResultCode.Text = ""; }
|
||||
#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)
|
||||
{
|
||||
#region 获取MD5
|
||||
@@ -178,6 +201,53 @@ namespace 开发辅助工具.Tools
|
||||
catch { TxtResultCode.Text = ""; }
|
||||
#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)
|
||||
{
|
||||
@@ -254,5 +324,35 @@ namespace 开发辅助工具.Tools
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Generated
+20
-20
@@ -31,7 +31,6 @@
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmJson));
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.textEditorControl1 = new FastColoredTextBoxNS.FastColoredTextBox();
|
||||
this.treeView1 = new System.Windows.Forms.TreeView();
|
||||
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.复制键名ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@@ -39,13 +38,13 @@
|
||||
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
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.BtnFormat = new System.Windows.Forms.ToolStripButton();
|
||||
this.BtnPasteJson = new System.Windows.Forms.ToolStripButton();
|
||||
this.BtnCopyJson = new System.Windows.Forms.ToolStripButton();
|
||||
this.CopyJsonByCHS = new System.Windows.Forms.ToolStripButton();
|
||||
this.menuRight1 = new ryPaiban.Model.MenuRight(this.components);
|
||||
this.highlightEditor1 = new ryControls.HighlightEditor();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
@@ -62,7 +61,7 @@
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.textEditorControl1);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.highlightEditor1);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
@@ -70,16 +69,6 @@
|
||||
this.splitContainer1.Size = new System.Drawing.Size(800, 491);
|
||||
this.splitContainer1.SplitterDistance = 400;
|
||||
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
|
||||
//
|
||||
@@ -139,11 +128,6 @@
|
||||
this.折叠ToolStripMenuItem.Text = "折叠";
|
||||
this.折叠ToolStripMenuItem.Click += new System.EventHandler(this.折叠ToolStripMenuItem_Click);
|
||||
//
|
||||
// contextMenuStripHighlightText1
|
||||
//
|
||||
this.contextMenuStripHighlightText1.Name = "contextMenuStripHighlightText1";
|
||||
this.contextMenuStripHighlightText1.Size = new System.Drawing.Size(101, 186);
|
||||
//
|
||||
// toolStrip1
|
||||
//
|
||||
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
@@ -203,6 +187,23 @@
|
||||
this.menuRight1.Size = new System.Drawing.Size(185, 92);
|
||||
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
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
@@ -231,7 +232,6 @@
|
||||
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.TreeView treeView1;
|
||||
private ryProcessManager.hezuo.ContextMenuStripHighlightText contextMenuStripHighlightText1;
|
||||
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
|
||||
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.ToolStripButton CopyJsonByCHS;
|
||||
private FastColoredTextBoxNS.FastColoredTextBox textEditorControl1;
|
||||
private ryControls.HighlightEditor highlightEditor1;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using FastColoredTextBoxNS;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -19,51 +18,6 @@ namespace 开发辅助工具.Tools
|
||||
public FrmJson()
|
||||
{
|
||||
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)
|
||||
{
|
||||
@@ -119,8 +73,8 @@ namespace 开发辅助工具.Tools
|
||||
{
|
||||
try
|
||||
{
|
||||
textEditorControl1.Text = Manager.Json.ConvertJsonString(json_text);
|
||||
textEditorControl1.Refresh();
|
||||
highlightEditor1.SetHightlightText(Manager.Json.ConvertJsonString(json_text),"json");
|
||||
highlightEditor1.Refresh();
|
||||
JObject jo = null;
|
||||
if (Manager.Json.IsArray(json_text))
|
||||
{
|
||||
@@ -225,12 +179,12 @@ namespace 开发辅助工具.Tools
|
||||
}
|
||||
private void BtnFormat_Click(object sender, EventArgs e)
|
||||
{
|
||||
Format(textEditorControl1.Text);
|
||||
Format(highlightEditor1.Text);
|
||||
}
|
||||
public void LoadJson(string json_text)
|
||||
{
|
||||
textEditorControl1.Text = json_text;
|
||||
textEditorControl1.Refresh();
|
||||
highlightEditor1.SetHightlightText(json_text,"json");
|
||||
highlightEditor1.Refresh();
|
||||
BtnFormat.PerformClick();
|
||||
}
|
||||
private void 复制键名ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
@@ -255,7 +209,7 @@ namespace 开发辅助工具.Tools
|
||||
|
||||
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)
|
||||
@@ -289,7 +243,7 @@ namespace 开发辅助工具.Tools
|
||||
{
|
||||
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 });
|
||||
ryCommon.RyFiles.CopyToClip(aa);
|
||||
}
|
||||
|
||||
@@ -117,10 +117,6 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</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">
|
||||
<value>262, 17</value>
|
||||
</metadata>
|
||||
|
||||
@@ -154,23 +154,11 @@ namespace 开发辅助工具.Tools
|
||||
string _ProjectPath = "";
|
||||
private string GetPath(string _path)
|
||||
{
|
||||
string tmp_path = _path;
|
||||
if (_path.IndexOf("..") == 0)
|
||||
{
|
||||
tmp_path = System.IO.Path.GetDirectoryName(System.IO.Path.GetDirectoryName(_ProjectPath).Trim('\\'));
|
||||
tmp_path = tmp_path + "\\" + _path.Substring(2);
|
||||
}
|
||||
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("\\\\", "\\");
|
||||
var cur_dir = Environment.CurrentDirectory;
|
||||
Environment.CurrentDirectory = System.IO.Path.GetDirectoryName(_ProjectPath);
|
||||
var tmp_path = System.IO.Path.GetFullPath(_path);
|
||||
Environment.CurrentDirectory = cur_dir;
|
||||
return tmp_path;
|
||||
}
|
||||
private string GetDebugPath()
|
||||
{
|
||||
|
||||
Generated
+5
-1
@@ -201,6 +201,7 @@
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
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.ButtonRoundBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(239)))), ((int)(((byte)(244)))));
|
||||
this.RySearchRegex.EmptyText = "";
|
||||
this.RySearchRegex.Location = new System.Drawing.Point(81, 6);
|
||||
this.RySearchRegex.Name = "RySearchRegex";
|
||||
@@ -220,7 +221,7 @@
|
||||
// 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;
|
||||
//
|
||||
// TxtRegexInput
|
||||
@@ -230,6 +231,7 @@
|
||||
this.TxtRegexInput.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.TxtRegexInput.DetectUrls = false;
|
||||
this.TxtRegexInput.EmptyText = "在此输入待匹配文本";
|
||||
this.TxtRegexInput.Font = new System.Drawing.Font("Courier New", 10F);
|
||||
this.TxtRegexInput.ForeColor = System.Drawing.Color.Black;
|
||||
this.TxtRegexInput.Location = new System.Drawing.Point(12, 37);
|
||||
this.TxtRegexInput.Name = "TxtRegexInput";
|
||||
@@ -237,6 +239,7 @@
|
||||
this.TxtRegexInput.Size = new System.Drawing.Size(825, 158);
|
||||
this.TxtRegexInput.TabIndex = 18;
|
||||
this.TxtRegexInput.Text = "";
|
||||
this.TxtRegexInput.WordWrap = false;
|
||||
this.TxtRegexInput.DoubleClick += new System.EventHandler(this.TxtRegexInput_DoubleClick);
|
||||
//
|
||||
// FrmRegex
|
||||
@@ -254,6 +257,7 @@
|
||||
this.Name = "FrmRegex";
|
||||
this.TabPageContextMenuStrip = this.menuRight1;
|
||||
this.Text = "正则表达式";
|
||||
this.Load += new System.EventHandler(this.FrmRegex_Load);
|
||||
this.tabControl3.ResumeLayout(false);
|
||||
this.TabTxtResult.ResumeLayout(false);
|
||||
this.tabPage10.ResumeLayout(false);
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace 开发辅助工具.Tools
|
||||
{
|
||||
option = RegexOptions.IgnoreCase;
|
||||
}
|
||||
if (Multiline) { option = option | RegexOptions.Multiline; }
|
||||
if (Multiline) { option |= RegexOptions.Multiline; }
|
||||
Regex reg = new Regex(RegexText, option);
|
||||
//返回一个结果集
|
||||
MatchCollection result = reg.Matches(RegexInput);
|
||||
@@ -106,5 +106,9 @@ namespace 开发辅助工具.Tools
|
||||
txt.Text = frm.richTextBox1.Text;
|
||||
}
|
||||
}
|
||||
|
||||
private void FrmRegex_Load(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
+22
-20
@@ -30,17 +30,11 @@
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
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.TxtFromCode = new ryControls.Controls.RichTextBox2();
|
||||
this.fastColoredTextBox1 = new FastColoredTextBoxNS.FastColoredTextBox();
|
||||
this.highlightEditor1 = new ryControls.HighlightEditor();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// contextMenuStripHighlightText1
|
||||
//
|
||||
this.contextMenuStripHighlightText1.Name = "contextMenuStripHighlightText1";
|
||||
this.contextMenuStripHighlightText1.Size = new System.Drawing.Size(101, 186);
|
||||
//
|
||||
// menuRight1
|
||||
//
|
||||
this.menuRight1.Name = "menuRight1";
|
||||
@@ -54,6 +48,7 @@
|
||||
this.TxtFromCode.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.TxtFromCode.DetectUrls = false;
|
||||
this.TxtFromCode.EmptyText = "请填写待计算的字符串";
|
||||
this.TxtFromCode.Font = new System.Drawing.Font("Courier New", 10F);
|
||||
this.TxtFromCode.ForeColor = System.Drawing.Color.Black;
|
||||
this.TxtFromCode.Location = new System.Drawing.Point(12, 3);
|
||||
this.TxtFromCode.Name = "TxtFromCode";
|
||||
@@ -61,41 +56,48 @@
|
||||
this.TxtFromCode.Size = new System.Drawing.Size(812, 207);
|
||||
this.TxtFromCode.TabIndex = 30;
|
||||
this.TxtFromCode.Text = "";
|
||||
this.TxtFromCode.WordWrap = false;
|
||||
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.Right)));
|
||||
this.fastColoredTextBox1.AutoScrollMinSize = new System.Drawing.Size(27, 14);
|
||||
this.fastColoredTextBox1.ContextMenuStrip = this.contextMenuStripHighlightText1;
|
||||
this.fastColoredTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam;
|
||||
this.fastColoredTextBox1.Font = new System.Drawing.Font("Courier New", 9.75F);
|
||||
this.fastColoredTextBox1.Location = new System.Drawing.Point(12, 216);
|
||||
this.fastColoredTextBox1.Name = "fastColoredTextBox1";
|
||||
this.fastColoredTextBox1.Size = new System.Drawing.Size(812, 277);
|
||||
this.fastColoredTextBox1.TabIndex = 31;
|
||||
this.highlightEditor1.AutoCAutoHide = false;
|
||||
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.LexerName = null;
|
||||
this.highlightEditor1.Location = new System.Drawing.Point(12, 216);
|
||||
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
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(836, 495);
|
||||
this.Controls.Add(this.fastColoredTextBox1);
|
||||
this.Controls.Add(this.highlightEditor1);
|
||||
this.Controls.Add(this.TxtFromCode);
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "FrmStrCount";
|
||||
this.TabPageContextMenuStrip = this.menuRight1;
|
||||
this.Text = "字符串统计";
|
||||
this.Load += new System.EventHandler(this.FrmStrCount_Load);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private ryProcessManager.hezuo.ContextMenuStripHighlightText contextMenuStripHighlightText1;
|
||||
private ryPaiban.Model.MenuRight menuRight1;
|
||||
private ryControls.Controls.RichTextBox2 TxtFromCode;
|
||||
private FastColoredTextBoxNS.FastColoredTextBox fastColoredTextBox1;
|
||||
private ryControls.HighlightEditor highlightEditor1;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using ryControls;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
@@ -15,7 +16,7 @@ namespace 开发辅助工具.Tools
|
||||
public FrmStrCount()
|
||||
{
|
||||
InitializeComponent();
|
||||
fastColoredTextBox1.ReadOnly = true;
|
||||
highlightEditor1.ReadOnly = true;
|
||||
}
|
||||
|
||||
private void TxtFromCode_TextChanged(object sender, EventArgs e)
|
||||
@@ -23,13 +24,20 @@ namespace 开发辅助工具.Tools
|
||||
Manager.TotalCount totalCount = new Manager.TotalCount();
|
||||
string fromText = TxtFromCode.Text;
|
||||
int iCount = totalCount.GetByteLength(fromText, out int HanziCount, out int engCount, out int NumCount);
|
||||
string resultStr = "";
|
||||
string resultStr;
|
||||
resultStr = "字节数: " + iCount.ToString() + "个(汉字算两个字符)";
|
||||
resultStr += "\r\n字数: " + fromText.Length.ToString() + "个(汉字算一个字符)";
|
||||
resultStr += "\r\n汉字数: " + HanziCount.ToString() + "个(汉字算一个字符)";
|
||||
resultStr += "\r\n英文数量: " + engCount.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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,13 +117,9 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</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">
|
||||
<value>262, 17</value>
|
||||
</metadata>
|
||||
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
|
||||
+22
-21
@@ -28,15 +28,13 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmStrToCode));
|
||||
this.RbStrToC = new System.Windows.Forms.RadioButton();
|
||||
this.RbStrToJS = new System.Windows.Forms.RadioButton();
|
||||
this.RbStrToQuickJS = new System.Windows.Forms.RadioButton();
|
||||
this.RbStrToASP = new System.Windows.Forms.RadioButton();
|
||||
this.TxtFromCode = new ryControls.Controls.RichTextBox2();
|
||||
this.fastColoredTextBox1 = new FastColoredTextBoxNS.FastColoredTextBox();
|
||||
this.contextMenuStripHighlightText1 = new ryProcessManager.hezuo.ContextMenuStripHighlightText();
|
||||
this.highlightEditor1 = new ryControls.HighlightEditor();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// RbStrToC
|
||||
@@ -91,6 +89,7 @@
|
||||
this.TxtFromCode.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.TxtFromCode.DetectUrls = false;
|
||||
this.TxtFromCode.EmptyText = "请填写待转换的内容";
|
||||
this.TxtFromCode.Font = new System.Drawing.Font("Courier New", 10F);
|
||||
this.TxtFromCode.ForeColor = System.Drawing.Color.Black;
|
||||
this.TxtFromCode.Location = new System.Drawing.Point(12, 3);
|
||||
this.TxtFromCode.Name = "TxtFromCode";
|
||||
@@ -98,34 +97,36 @@
|
||||
this.TxtFromCode.Size = new System.Drawing.Size(812, 207);
|
||||
this.TxtFromCode.TabIndex = 31;
|
||||
this.TxtFromCode.Text = "";
|
||||
this.TxtFromCode.WordWrap = false;
|
||||
this.TxtFromCode.TextChanged += new System.EventHandler(this.TxtFromCode_TextChanged);
|
||||
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.Right)));
|
||||
this.fastColoredTextBox1.AutoScrollMinSize = new System.Drawing.Size(27, 14);
|
||||
this.fastColoredTextBox1.ContextMenuStrip = this.contextMenuStripHighlightText1;
|
||||
this.fastColoredTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam;
|
||||
this.fastColoredTextBox1.Font = new System.Drawing.Font("Courier New", 9.75F);
|
||||
this.fastColoredTextBox1.Location = new System.Drawing.Point(12, 238);
|
||||
this.fastColoredTextBox1.Name = "fastColoredTextBox1";
|
||||
this.fastColoredTextBox1.Size = new System.Drawing.Size(812, 255);
|
||||
this.fastColoredTextBox1.TabIndex = 32;
|
||||
//
|
||||
// contextMenuStripHighlightText1
|
||||
//
|
||||
this.contextMenuStripHighlightText1.Name = "contextMenuStripHighlightText1";
|
||||
this.contextMenuStripHighlightText1.Size = new System.Drawing.Size(101, 186);
|
||||
this.highlightEditor1.AutoCAutoHide = false;
|
||||
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.LexerName = null;
|
||||
this.highlightEditor1.Location = new System.Drawing.Point(12, 238);
|
||||
this.highlightEditor1.Name = "highlightEditor1";
|
||||
this.highlightEditor1.ScrollWidth = 88;
|
||||
this.highlightEditor1.Size = new System.Drawing.Size(812, 245);
|
||||
this.highlightEditor1.TabIndents = true;
|
||||
this.highlightEditor1.TabIndex = 32;
|
||||
this.highlightEditor1.UseRightToLeftReadingLayout = false;
|
||||
this.highlightEditor1.WrapMode = ScintillaNET.WrapMode.None;
|
||||
//
|
||||
// FrmStrToCode
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
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.RbStrToASP);
|
||||
this.Controls.Add(this.RbStrToQuickJS);
|
||||
@@ -134,6 +135,7 @@
|
||||
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
|
||||
this.Name = "FrmStrToCode";
|
||||
this.Text = "字符串转代码";
|
||||
this.Load += new System.EventHandler(this.FrmStrToCode_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@@ -146,7 +148,6 @@
|
||||
private System.Windows.Forms.RadioButton RbStrToASP;
|
||||
private ryPaiban.Model.MenuRight menuRight1;
|
||||
private ryControls.Controls.RichTextBox2 TxtFromCode;
|
||||
private FastColoredTextBoxNS.FastColoredTextBox fastColoredTextBox1;
|
||||
private ryProcessManager.hezuo.ContextMenuStripHighlightText contextMenuStripHighlightText1;
|
||||
private ryControls.HighlightEditor highlightEditor1;
|
||||
}
|
||||
}
|
||||
@@ -1,131 +1,91 @@
|
||||
using FastColoredTextBoxNS;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Forms;
|
||||
using WeifenLuo.WinFormsUI.Docking;
|
||||
|
||||
namespace 开发辅助工具.Tools
|
||||
{
|
||||
public partial class FrmStrToCode : DockContent
|
||||
{
|
||||
public FrmStrToCode()
|
||||
{
|
||||
InitializeComponent();
|
||||
fastColoredTextBox1.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 Convert()
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (RbStrToC.Checked)
|
||||
{
|
||||
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(\"") + "\");");
|
||||
fastColoredTextBox1.Language = FastColoredTextBoxNS.Language.CSharp;
|
||||
}
|
||||
else if (RbStrToJS.Checked)
|
||||
{
|
||||
builder.Append("var sb=\"" + this.TxtFromCode.Text.Trim().Replace("\"", "\\\"").Replace("\r\n", "\n").Replace("\n", "\";\r\n sb=sb+\"") + "\";");
|
||||
fastColoredTextBox1.Language = FastColoredTextBoxNS.Language.JS;
|
||||
}
|
||||
else if (RbStrToQuickJS.Checked)
|
||||
{
|
||||
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);");
|
||||
builder.Insert(0, "<script>\r\n");
|
||||
builder.Append ("\r\n</script>");
|
||||
fastColoredTextBox1.Language = FastColoredTextBoxNS.Language.HTML;
|
||||
}
|
||||
else if (RbStrToASP.Checked)
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
using System.Windows.Forms;
|
||||
using WeifenLuo.WinFormsUI.Docking;
|
||||
|
||||
namespace 开发辅助工具.Tools
|
||||
{
|
||||
public partial class FrmStrToCode : DockContent
|
||||
{
|
||||
public FrmStrToCode()
|
||||
{
|
||||
InitializeComponent();
|
||||
highlightEditor1.ReadOnly = true;
|
||||
}
|
||||
private void Convert()
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
var formart = "";
|
||||
if (RbStrToC.Checked)
|
||||
{
|
||||
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(\"") + "\");");
|
||||
formart = "c#";
|
||||
}
|
||||
else if (RbStrToJS.Checked)
|
||||
{
|
||||
builder.Append("var sb=\"" + this.TxtFromCode.Text.Trim().Replace("\"", "\\\"").Replace("\r\n", "\n").Replace("\n", "\";\r\n sb=sb+\"") + "\";");
|
||||
formart = "js";
|
||||
}
|
||||
else if (RbStrToQuickJS.Checked)
|
||||
{
|
||||
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);");
|
||||
builder.Insert(0, "<script>\r\n");
|
||||
builder.Append ("\r\n</script>");
|
||||
formart = "html";
|
||||
}
|
||||
else if (RbStrToASP.Checked)
|
||||
{
|
||||
builder.Append("sb=\"" + this.TxtFromCode.Text.Trim().Replace("\"", "\"\"").Replace("\r\n", "\n").Replace("\n", "\" & vbCrLf \r\nsb=sb & \"") + "\"");
|
||||
formart = "vb";
|
||||
}
|
||||
highlightEditor1.SetHightlightText(builder.ToString(),formart);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
private void FrmStrToCode_Load(object sender, EventArgs e)
|
||||
{
|
||||
highlightEditor1.SetFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,10 +117,6 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</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" />
|
||||
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
|
||||
+152
-143
@@ -30,14 +30,12 @@
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
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.tabPage3 = new System.Windows.Forms.TabPage();
|
||||
this.pictureBox1 = new System.Windows.Forms.PictureBox();
|
||||
this.RichHtml = new ryControls.Controls.RichTextBox2();
|
||||
this.tabPage12 = new System.Windows.Forms.TabPage();
|
||||
this.Te_Format = new FastColoredTextBoxNS.FastColoredTextBox();
|
||||
this.contextMenuStripHighlightText1 = new ryProcessManager.hezuo.ContextMenuStripHighlightText();
|
||||
this.highlightEditor1 = new ryControls.HighlightEditor();
|
||||
this.tabPage4 = new System.Windows.Forms.TabPage();
|
||||
this.RichCookie = new ryControls.Controls.RichTextBox2();
|
||||
this.tabPage5 = new System.Windows.Forms.TabPage();
|
||||
@@ -74,22 +72,24 @@
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.CbbEncoding = new ryControls.RyComboBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.BtnRunHtml = new ryControls.ButtonEx();
|
||||
this.RbPost = 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.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.置顶收藏该项ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.删除该项ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
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.tabPage3.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
|
||||
@@ -105,20 +105,11 @@
|
||||
this.tabPage7.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.objectListView2)).BeginInit();
|
||||
this.contextMenuStrip1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.objectListView2)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.BtnMore)).BeginInit();
|
||||
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
|
||||
//
|
||||
this.tabControl2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
@@ -176,7 +167,7 @@
|
||||
//
|
||||
// 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.Name = "tabPage12";
|
||||
this.tabPage12.Padding = new System.Windows.Forms.Padding(3);
|
||||
@@ -185,22 +176,26 @@
|
||||
this.tabPage12.Text = "HTML格式化";
|
||||
this.tabPage12.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// Te_Format
|
||||
// highlightEditor1
|
||||
//
|
||||
this.Te_Format.AutoScrollMinSize = new System.Drawing.Size(0, 17);
|
||||
this.Te_Format.ContextMenuStrip = this.contextMenuStripHighlightText1;
|
||||
this.Te_Format.Cursor = System.Windows.Forms.Cursors.IBeam;
|
||||
this.Te_Format.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.Te_Format.ImeMode = System.Windows.Forms.ImeMode.On;
|
||||
this.Te_Format.Location = new System.Drawing.Point(3, 3);
|
||||
this.Te_Format.Name = "Te_Format";
|
||||
this.Te_Format.Size = new System.Drawing.Size(875, 274);
|
||||
this.Te_Format.TabIndex = 24;
|
||||
//
|
||||
// contextMenuStripHighlightText1
|
||||
//
|
||||
this.contextMenuStripHighlightText1.Name = "contextMenuStripHighlightText1";
|
||||
this.contextMenuStripHighlightText1.Size = new System.Drawing.Size(101, 186);
|
||||
this.highlightEditor1.AutoCAutoHide = false;
|
||||
this.highlightEditor1.AutoCMaxHeight = 9;
|
||||
this.highlightEditor1.BiDirectionality = ScintillaNET.BiDirectionalDisplayType.Disabled;
|
||||
this.highlightEditor1.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
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.Font = new System.Drawing.Font("Consolas", 11.25F);
|
||||
this.highlightEditor1.LexerName = null;
|
||||
this.highlightEditor1.Location = new System.Drawing.Point(3, 3);
|
||||
this.highlightEditor1.Name = "highlightEditor1";
|
||||
this.highlightEditor1.ReadOnly = true;
|
||||
this.highlightEditor1.ScrollWidth = 1;
|
||||
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
|
||||
//
|
||||
@@ -686,21 +681,10 @@
|
||||
this.label3.TabIndex = 0;
|
||||
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
|
||||
//
|
||||
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.Size = new System.Drawing.Size(47, 16);
|
||||
this.RbPost.TabIndex = 103;
|
||||
@@ -711,7 +695,7 @@
|
||||
//
|
||||
this.RbGet.AutoSize = 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.Size = new System.Drawing.Size(41, 16);
|
||||
this.RbGet.TabIndex = 102;
|
||||
@@ -719,30 +703,6 @@
|
||||
this.RbGet.Text = "Get";
|
||||
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
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
@@ -752,66 +712,6 @@
|
||||
this.label2.TabIndex = 101;
|
||||
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
|
||||
//
|
||||
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
@@ -821,7 +721,7 @@
|
||||
this.设置备注ToolStripMenuItem});
|
||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
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
|
||||
//
|
||||
@@ -849,14 +749,123 @@
|
||||
this.设置备注ToolStripMenuItem.Text = "设置备注";
|
||||
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
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(909, 620);
|
||||
this.Controls.Add(this.BtnMore);
|
||||
this.Controls.Add(this.TxtUrl);
|
||||
this.Controls.Add(this.BtnCtreateCShape);
|
||||
this.Controls.Add(this.ChkUrlLower);
|
||||
this.Controls.Add(this.tabControl2);
|
||||
this.Controls.Add(this.groupBox3);
|
||||
this.Controls.Add(this.groupBox2);
|
||||
@@ -889,16 +898,15 @@
|
||||
this.groupBox2.PerformLayout();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.objectListView2)).EndInit();
|
||||
this.contextMenuStrip1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.objectListView2)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.BtnMore)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.CheckBox ChkUrlLower;
|
||||
private System.Windows.Forms.TabControl tabControl2;
|
||||
private System.Windows.Forms.TabPage tabPage3;
|
||||
private System.Windows.Forms.PictureBox pictureBox1;
|
||||
@@ -930,10 +938,8 @@
|
||||
private System.Windows.Forms.RadioButton RbGet;
|
||||
private ryControls.TextBoxEx2 TxtUrl;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private ryProcessManager.hezuo.ContextMenuStripHighlightText contextMenuStripHighlightText1;
|
||||
private ryPaiban.Model.MenuRight menuRight1;
|
||||
private ryControls.ButtonEx BtnCtreateCShape;
|
||||
private System.Windows.Forms.Timer timer1;
|
||||
private System.Windows.Forms.TabControl tabControl1;
|
||||
private System.Windows.Forms.TabPage tabPage1;
|
||||
private System.Windows.Forms.TabPage tabPage2;
|
||||
@@ -945,7 +951,6 @@
|
||||
private ExtendedWebBrowser2.ExtendedWebBrowser extendedWebBrowser1;
|
||||
private System.Windows.Forms.CheckBox ChkHtmlPreview;
|
||||
private System.Windows.Forms.CheckBox ChkNoPreview;
|
||||
private FastColoredTextBoxNS.FastColoredTextBox Te_Format;
|
||||
private BrightIdeasSoftware.ObjectListView objectListView2;
|
||||
private BrightIdeasSoftware.OLVColumn OlvUrl;
|
||||
private BrightIdeasSoftware.OLVColumn OlvName;
|
||||
@@ -958,5 +963,9 @@
|
||||
private System.Windows.Forms.ToolStripMenuItem 删除该项ToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
|
||||
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;
|
||||
}
|
||||
}
|
||||
+162
-106
@@ -1,16 +1,21 @@
|
||||
using BrightIdeasSoftware;
|
||||
using DotNet4.Utilities;
|
||||
using FastColoredTextBoxNS;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using ryCommon;
|
||||
using ryCommonDb;
|
||||
using ryControls;
|
||||
using ryProcessManager.hezuo;
|
||||
using ScintillaNET;
|
||||
using Sheng.Winform.Controls.PopupControl;
|
||||
using SuperDesign.Controls;
|
||||
using SuperDesign.Tools;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Design;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
@@ -20,8 +25,10 @@ using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using VPKSoft.ScintillaLexers;
|
||||
using WeifenLuo.WinFormsUI.Docking;
|
||||
using 开发辅助工具.Manager;
|
||||
using static ScintillaNET.Style;
|
||||
|
||||
namespace 开发辅助工具.Tools
|
||||
{
|
||||
@@ -32,12 +39,6 @@ namespace 开发辅助工具.Tools
|
||||
InitializeComponent();
|
||||
LoadPram();
|
||||
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; };
|
||||
OlvName.AspectGetter = delegate (object x) {
|
||||
var item = (UrlInfo)x;
|
||||
@@ -50,29 +51,31 @@ namespace 开发辅助工具.Tools
|
||||
};
|
||||
//OlvUrl.Renderer = CreateDescribedTaskRenderer();
|
||||
objectListView2.FormatRow += ObjectListView2_FormatRow;
|
||||
|
||||
}
|
||||
private DescribedTaskRenderer CreateDescribedTaskRenderer()
|
||||
{
|
||||
|
||||
// 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.
|
||||
// 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
|
||||
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;
|
||||
// Use older Gdi renderering, since most people think the text looks clearer
|
||||
UseGdiTextRendering = true
|
||||
};
|
||||
|
||||
// If you like colours other than black and grey, you could uncomment these
|
||||
// renderer.TitleColor = Color.DarkBlue;
|
||||
@@ -86,48 +89,8 @@ namespace 开发辅助工具.Tools
|
||||
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()
|
||||
{
|
||||
Te_Format.ReadOnly = true;
|
||||
CbbContentType.SelectedIndex = 0;
|
||||
CbbUserAgent.SelectedIndex = 0;
|
||||
CbbEncoding.SelectedIndex = 0;
|
||||
@@ -168,8 +131,10 @@ namespace 开发辅助工具.Tools
|
||||
});
|
||||
TxtPost.AddMenu("插入时间戳", "").Click += new EventHandler((object sender2, EventArgs e2) =>
|
||||
{
|
||||
SuperDesign.Controls.FrmInsertUnixTime frm = new SuperDesign.Controls.FrmInsertUnixTime();
|
||||
frm.Icon = Icon;
|
||||
SuperDesign.Controls.FrmInsertUnixTime frm = new SuperDesign.Controls.FrmInsertUnixTime
|
||||
{
|
||||
Icon = Icon
|
||||
};
|
||||
var text = TxtPost.SelectedText;
|
||||
if(text.Length>4 && text.IsInt())
|
||||
{
|
||||
@@ -199,6 +164,7 @@ namespace 开发辅助工具.Tools
|
||||
Thread th;
|
||||
private void BtnRunHtml_Click(object sender, EventArgs e)
|
||||
{
|
||||
objectListView2.Visible = false;
|
||||
if (IsRunning) {
|
||||
IsExit = true;
|
||||
BtnRunHtml.Text = "停止中"; ;
|
||||
@@ -213,7 +179,7 @@ namespace 开发辅助工具.Tools
|
||||
BtnRunHtml.Text = "停止执行"; ;
|
||||
#region 将当前设置赋值到查询
|
||||
this.RichHtml.Text = "正在获取数据...";
|
||||
Te_Format.Text = "正在获取数据...";
|
||||
highlightEditor1.Text="正在获取数据...";
|
||||
this.RichCookie.Text = "";
|
||||
RichHeader.Text = "";
|
||||
RichStatus.Text = "";
|
||||
@@ -256,12 +222,11 @@ namespace 开发辅助工具.Tools
|
||||
{
|
||||
URL = TxtUrl.Text.Trim(),
|
||||
Method = str,
|
||||
IsToLower = this.ChkUrlLower.Checked,
|
||||
Cookie = this.TxtCookie.Text.Trim(),
|
||||
Referer = this.CbbReferer.Text.Trim(),
|
||||
Postdata = PostData,
|
||||
Timeout = Convert.ToInt32(this.CbbTimeout.Text.Replace("秒", string.Empty).Trim()) * 0x3e8,
|
||||
ReadWriteTimeout = Convert.ToInt32(this.CbbWriteTimeout.Text.Replace("秒", string.Empty).Trim()) * 0x3e8,
|
||||
Timeout = this.CbbTimeout.Text.Replace("秒", string.Empty).Trim().ToInt() * 0x3e8,
|
||||
ReadWriteTimeout = this.CbbWriteTimeout.Text.Replace("秒", string.Empty).Trim().ToInt() * 0x3e8,
|
||||
UserAgent = this.CbbUserAgent.Text,
|
||||
ContentType = this.CbbContentType.Text,
|
||||
Allowautoredirect = this.ChkJump.Checked,
|
||||
@@ -288,7 +253,7 @@ namespace 开发辅助工具.Tools
|
||||
catch (Exception exception)
|
||||
{
|
||||
this.RichHtml.Text = exception.Message;
|
||||
Te_Format.Text = "";
|
||||
highlightEditor1.Text = "";
|
||||
tabControl2.SelectedIndex = 0;
|
||||
BtnRunHtml.Text = "执行";
|
||||
IsRunning = false;
|
||||
@@ -297,9 +262,9 @@ namespace 开发辅助工具.Tools
|
||||
}
|
||||
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()))
|
||||
@@ -325,13 +290,13 @@ namespace 开发辅助工具.Tools
|
||||
DateTime dt = DateTime.Now;
|
||||
var result = http.GetHtml(item);
|
||||
DateTime dt_end = DateTime.Now;
|
||||
_ = this.Invoke(new Action(() =>
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
#region 将获得的结果显示出来
|
||||
if (result.Html.Length > 1024 * 1024 * 4)
|
||||
{
|
||||
this.RichHtml.Text = "获取失败,您要获取的网页超过4MB,暂时无法获取。";
|
||||
Te_Format.Text = "获取失败,您要获取的网页超过4MB,暂时无法获取。";
|
||||
highlightEditor1.Text = "获取失败,您要获取的网页超过4MB,暂时无法获取。";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -363,8 +328,7 @@ namespace 开发辅助工具.Tools
|
||||
this.RichHtml.Text = result.Html;
|
||||
if (Manager.Json.IsJson(result.Html))
|
||||
{
|
||||
Te_Format.Language = Language.JSON;
|
||||
Te_Format.Text = Manager.Json.ConvertJsonString(result.Html);
|
||||
highlightEditor1.SetHightlightText(Manager.Json.ConvertJsonString(result.Html), "json");
|
||||
AddUrl("", TxtUrl.Text);
|
||||
}
|
||||
else
|
||||
@@ -380,15 +344,17 @@ namespace 开发辅助工具.Tools
|
||||
if (_html.Length > 0) { _html += "\r\n"; }
|
||||
_html += _format_html[i];
|
||||
}
|
||||
Te_Format.Language = Language.HTML;
|
||||
try
|
||||
{
|
||||
Te_Format.Text = JJCCX.Xml.HtmlFormater.ConvertToXml(_html, true);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Te_Format.Text = _html;
|
||||
}
|
||||
//try
|
||||
//{
|
||||
// var html2 = JJCCX.Xml.HtmlFormater.ConvertToXml(_html, true);
|
||||
// scintilla1.Text = html2;
|
||||
//}
|
||||
//catch(Exception ex)
|
||||
//{
|
||||
// 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)
|
||||
{
|
||||
string title = "";
|
||||
@@ -433,7 +399,7 @@ namespace 开发辅助工具.Tools
|
||||
{
|
||||
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);
|
||||
//extendedWebBrowser1.Document.Encoding = Encoding.UTF8.BodyName;
|
||||
}
|
||||
@@ -471,7 +437,7 @@ namespace 开发辅助工具.Tools
|
||||
{
|
||||
this.RichHtml.Text = exception.Message;
|
||||
}
|
||||
Te_Format.Text = "";
|
||||
highlightEditor1.Text = "";
|
||||
}));
|
||||
}
|
||||
this.Invoke(new Action(() =>
|
||||
@@ -507,10 +473,12 @@ namespace 开发辅助工具.Tools
|
||||
}
|
||||
private void FrmWebGet_Load(object sender, EventArgs e)
|
||||
{
|
||||
highlightEditor1.SetFocus();
|
||||
//TxtPost.AutoWordSelection = false;
|
||||
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; //加上这一句
|
||||
contextMenuStripHighlightText1.AddSeparatorMenu();
|
||||
contextMenuStripHighlightText1.AddMenu("将选中的内容作为Json分析", "").Click += AnalyJson_Click;
|
||||
var highlight_menu = (ContextMenuStripHighlightText2)highlightEditor1.ContextMenuStrip;
|
||||
highlight_menu.AddSeparatorMenu();
|
||||
highlight_menu.AddMenu("将选中的内容作为Json分析", "").Click += AnalyJson_Click;
|
||||
for (int i = 0; i < this.Controls.Count; i++)
|
||||
{
|
||||
switch (this.Controls[i])
|
||||
@@ -543,7 +511,7 @@ namespace 开发辅助工具.Tools
|
||||
ContextMenuStrip menu =(ContextMenuStrip) (((ToolStripMenuItem)sender).Owner);
|
||||
switch(menu.SourceControl)
|
||||
{
|
||||
case FastColoredTextBox rich_txt:
|
||||
case HighlightEditor rich_txt:
|
||||
var SelectedText= rich_txt.SelectedText;
|
||||
if (SelectedText == "") { SelectedText = rich_txt.Text; }
|
||||
//if (Manager.Json.IsJson(SelectedText))
|
||||
@@ -581,7 +549,6 @@ namespace 开发辅助工具.Tools
|
||||
{
|
||||
URL = TxtUrl.Text.Trim(),
|
||||
Method = str,
|
||||
IsToLower = this.ChkUrlLower.Checked,
|
||||
Cookie = this.TxtCookie.Text.Trim(),
|
||||
Referer = this.CbbReferer.Text.Trim(),
|
||||
Postdata = this.TxtPost.Text.Trim(),
|
||||
@@ -594,9 +561,9 @@ namespace 开发辅助工具.Tools
|
||||
};
|
||||
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()))
|
||||
@@ -620,7 +587,6 @@ namespace 开发辅助工具.Tools
|
||||
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(" IsToLower = " + item.IsToLower.ToString().ToLower() + ",//得到的HTML代码是否转成小写 可选项默认转小写 \r\n");
|
||||
builder.Append(" Cookie = \"" + item.Cookie + "\",//字符串Cookie 可选项 \r\n");
|
||||
builder.Append(" Referer =\"" + item.Referer + "\",//来源URL 可选项 \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(" }\r\n");
|
||||
RichHtml.Text = builder.ToString();
|
||||
Te_Format.Language = Language.CSharp;
|
||||
Te_Format.Text= builder.ToString();
|
||||
highlightEditor1.SetHightlightText(builder.ToString(), "c#");
|
||||
|
||||
}
|
||||
public void AddUrl(string title,string url)
|
||||
@@ -781,7 +746,6 @@ namespace 开发辅助工具.Tools
|
||||
#region 重新载入数据
|
||||
objectListView2.ClearObjects();
|
||||
List<UrlInfo> list = new List<UrlInfo>();
|
||||
DataProvider mydb = new DataProvider();
|
||||
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
|
||||
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
|
||||
{
|
||||
@@ -838,13 +802,7 @@ namespace 开发辅助工具.Tools
|
||||
objectListView2.Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void timer1_Tick(object sender, EventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private void table1_MouseClick(object sender, MouseEventArgs e)
|
||||
private void Table1_MouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
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;
|
||||
if (item == null) { return; }
|
||||
@@ -954,6 +912,104 @@ namespace 开发辅助工具.Tools
|
||||
}
|
||||
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
|
||||
{
|
||||
|
||||
@@ -117,16 +117,33 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="contextMenuStripHighlightText1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>33, 18</value>
|
||||
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>141, 17</value>
|
||||
</metadata>
|
||||
<metadata name="menuRight1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>603, 26</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>
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<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">
|
||||
<value>
|
||||
AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAAAAAAAAAAAAAAAAAAAA
|
||||
@@ -203,7 +220,4 @@
|
||||
AB8AAAA/AAAAfwYMAP8AAAH/AAAD/wAAA/8=
|
||||
</value>
|
||||
</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>
|
||||
Generated
+21
-24
@@ -33,12 +33,11 @@
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.TxtXML = new ryControls.Controls.RichTextBox2();
|
||||
this.panelEx1 = new ryControls.PanelEx();
|
||||
this.fastColoredTextBox1 = new FastColoredTextBoxNS.FastColoredTextBox();
|
||||
this.contextMenuStripHighlightText1 = new ryProcessManager.hezuo.ContextMenuStripHighlightText();
|
||||
this.RySearchXpath = new ryControls.rySearch();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.CbbXMLType = new ryControls.RyComboBox();
|
||||
this.menuRight1 = new ryPaiban.Model.MenuRight(this.components);
|
||||
this.highlightEditor1 = new ryControls.HighlightEditor();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
@@ -92,33 +91,15 @@
|
||||
| System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
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.Name = "panelEx1";
|
||||
this.panelEx1.Padding = new System.Windows.Forms.Padding(2);
|
||||
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.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
|
||||
//
|
||||
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.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
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
@@ -196,9 +194,8 @@
|
||||
private ryControls.rySearch RySearchXpath;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private ryControls.RyComboBox CbbXMLType;
|
||||
private ryProcessManager.hezuo.ContextMenuStripHighlightText contextMenuStripHighlightText1;
|
||||
private ryPaiban.Model.MenuRight menuRight1;
|
||||
private ryControls.Controls.RichTextBox2 TxtXML;
|
||||
private FastColoredTextBoxNS.FastColoredTextBox fastColoredTextBox1;
|
||||
private ryControls.HighlightEditor highlightEditor1;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using FastColoredTextBoxNS;
|
||||
using HtmlAgilityPack;
|
||||
using HtmlAgilityPack;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
@@ -21,62 +20,18 @@ namespace 开发辅助工具.Tools
|
||||
{
|
||||
InitializeComponent();
|
||||
CbbXMLType.SelectedIndex = 0;
|
||||
fastColoredTextBox1.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;
|
||||
}
|
||||
highlightEditor1.ReadOnly = true;
|
||||
}
|
||||
|
||||
private void RySearchXpath_OnSearch(object sender, EventArgs e)
|
||||
{
|
||||
string text = "";
|
||||
var format = "";
|
||||
try
|
||||
{
|
||||
if (CbbXMLType.SelectedIndex == 0)
|
||||
{
|
||||
fastColoredTextBox1.Language = Language.XML;
|
||||
format="xml";
|
||||
System.Xml.XmlDocument xml = new System.Xml.XmlDocument();
|
||||
xml.LoadXml(TxtXML.Text);
|
||||
var node = xml.SelectNodes(RySearchXpath.Text);
|
||||
@@ -91,7 +46,7 @@ namespace 开发辅助工具.Tools
|
||||
}
|
||||
else if (CbbXMLType.SelectedIndex == 1)
|
||||
{
|
||||
fastColoredTextBox1.Language = Language.HTML;
|
||||
format = "html";
|
||||
HtmlAgilityPack.HtmlDocument htmlDoc = new HtmlAgilityPack.HtmlDocument();
|
||||
htmlDoc.LoadHtml(TxtXML.Text);
|
||||
HtmlNodeCollection anchors = htmlDoc.DocumentNode.SelectNodes(RySearchXpath.Text);
|
||||
@@ -106,7 +61,7 @@ namespace 开发辅助工具.Tools
|
||||
}
|
||||
else if (CbbXMLType.SelectedIndex == 2)
|
||||
{
|
||||
fastColoredTextBox1.Language = Language.JSON;
|
||||
format = "json";
|
||||
try
|
||||
{
|
||||
JObject jo = (JObject)JsonConvert.DeserializeObject(TxtXML.Text);
|
||||
@@ -126,12 +81,12 @@ namespace 开发辅助工具.Tools
|
||||
{
|
||||
MessageBox.Show(ex.Message, "错误提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
}
|
||||
fastColoredTextBox1.Text = text;
|
||||
highlightEditor1.SetHightlightText(text,format);
|
||||
}
|
||||
|
||||
private void FrmXpath_Load(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
highlightEditor1.SetFocus();
|
||||
}
|
||||
|
||||
private void TxtXML_DoubleClick(object sender, EventArgs e)
|
||||
|
||||
@@ -117,9 +117,6 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</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">
|
||||
<value>262, 17</value>
|
||||
</metadata>
|
||||
|
||||
Reference in new issue
Block a user