### 2024-12-20 星期五更新
------ #### SuperDesign V3.0.2412.2001 - *.[新增]新增程序更新日志设置和自动发布功能。 - *.[修复]修复Post数据格式不正确时双击文本框会导致软件闪退的BUG。
This commit is contained in:
1 parent
03bcb8c5fd
commit
993f1ca1a9
349 files changed
+81977
-13873
No files matched your search
+69
@@ -0,0 +1,69 @@
|
||||
namespace ScintillaNET_FindReplaceDialog.FindAllResults
|
||||
{
|
||||
partial class FindAllResultsPanel
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Component Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.FindResultsScintilla = new ScintillaNET.Scintilla();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// FindResultsScintilla
|
||||
//
|
||||
this.FindResultsScintilla.AutoCMaxHeight = 9;
|
||||
this.FindResultsScintilla.BiDirectionality = ScintillaNET.BiDirectionalDisplayType.Disabled;
|
||||
this.FindResultsScintilla.CaretLineBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
|
||||
this.FindResultsScintilla.CaretLineVisible = true;
|
||||
this.FindResultsScintilla.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.FindResultsScintilla.LexerName = null;
|
||||
this.FindResultsScintilla.Location = new System.Drawing.Point(0, 0);
|
||||
this.FindResultsScintilla.Name = "FindResultsScintilla";
|
||||
this.FindResultsScintilla.ScrollWidth = 5001;
|
||||
this.FindResultsScintilla.Size = new System.Drawing.Size(556, 203);
|
||||
this.FindResultsScintilla.TabIndents = true;
|
||||
this.FindResultsScintilla.TabIndex = 4;
|
||||
this.FindResultsScintilla.Text = "搜索结果";
|
||||
this.FindResultsScintilla.WrapMode = ScintillaNET.WrapMode.None;
|
||||
this.FindResultsScintilla.KeyUp += new System.Windows.Forms.KeyEventHandler(this.FindResultsScintilla_KeyUp);
|
||||
this.FindResultsScintilla.MouseClick += new System.Windows.Forms.MouseEventHandler(this.FindResultsScintilla_MouseClick);
|
||||
this.FindResultsScintilla.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.FindResultsScintilla_MouseDoubleClick);
|
||||
//
|
||||
// FindAllResultsPanel
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.FindResultsScintilla);
|
||||
this.Name = "FindAllResultsPanel";
|
||||
this.Size = new System.Drawing.Size(556, 203);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private ScintillaNET.Scintilla FindResultsScintilla;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
namespace ScintillaNET_FindReplaceDialog.FindAllResults
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using ScintillaNET;
|
||||
|
||||
public partial class FindAllResultsPanel : UserControl
|
||||
{
|
||||
#region Fields
|
||||
|
||||
private readonly Dictionary<int, FindResult> _findAllResults=new Dictionary<int, FindResult>();
|
||||
|
||||
#endregion Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new instance of FindAllResultsPanel
|
||||
/// </summary>
|
||||
public FindAllResultsPanel()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
FindResultsScintilla.Styles[Style.Default].Font = "Consolas";
|
||||
FindResultsScintilla.Styles[Style.Default].Size = 10;
|
||||
|
||||
FindResultsScintilla.ClearAll();
|
||||
}
|
||||
public delegate void ResultEventHandler(object sender, FindResult r);
|
||||
/// <summary>
|
||||
/// 点击结果时发生
|
||||
/// </summary>
|
||||
[Description("点击结果时发生")]
|
||||
public event ResultEventHandler OnResultClick;
|
||||
#endregion Constructors
|
||||
|
||||
#region Properties
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Updates the find all results panel
|
||||
/// </summary>
|
||||
/// <param name="FindReplace">The FindReplace instance used to generate the find results.</param>
|
||||
/// <param name="FindAllResults"></param>
|
||||
public void UpdateFindAllResults(Dictionary<string,List<ScintillaNET_FindReplaceDialog.CharacterRange>> FindAllResults)
|
||||
{
|
||||
_findAllResults.Clear();
|
||||
FindResultsScintilla.ReadOnly = false;
|
||||
FindResultsScintilla.ClearAll();
|
||||
Indicator _indicator_title = FindResultsScintilla.Indicators[15];
|
||||
_indicator_title.ForeColor = Color.LightGreen;
|
||||
_indicator_title.Alpha = 100;
|
||||
_indicator_title.Style = IndicatorStyle.RoundBox;
|
||||
_indicator_title.Under = true;
|
||||
|
||||
Indicator _indicator = FindResultsScintilla.Indicators[16];
|
||||
_indicator.ForeColor = Color.Red;
|
||||
_indicator.Alpha = 100;
|
||||
_indicator.Style = IndicatorStyle.RoundBox;
|
||||
_indicator.Under = true;
|
||||
var line = 0;
|
||||
//Write lines
|
||||
foreach (var item in FindAllResults)
|
||||
{
|
||||
FindResultsScintilla.AppendText(item.Key+" (匹配"+ item.Value.Count+ "次)\r\n");
|
||||
_findAllResults.Add(line, new FindResult());
|
||||
FindResultsScintilla.Lines[line].ToggleFold();
|
||||
line++;
|
||||
foreach (var item_file in item.Value)
|
||||
{
|
||||
string resultsLinePrefix = string.Format("行 {0}: ", item_file.LineNum + 1);
|
||||
FindResultsScintilla.AppendText(string.Format("{0}{1}",
|
||||
resultsLinePrefix, item_file.RangeText.Replace("\n"," "))+"\r\n");
|
||||
_findAllResults.Add(line,new FindResult() { Path = item.Key, Result = item_file });
|
||||
line++;
|
||||
}
|
||||
//Highlight
|
||||
foreach (var item_file in _findAllResults)
|
||||
{
|
||||
var item_range = item_file.Value.Result;
|
||||
int lastLineStartPos = FindResultsScintilla.Lines[item_file.Key].Position;
|
||||
if (item_range == null) {
|
||||
FindResultsScintilla.IndicatorCurrent = _indicator_title.Index;
|
||||
FindResultsScintilla.IndicatorFillRange(lastLineStartPos, FindResultsScintilla.Lines[item_file.Key].Length);
|
||||
continue;
|
||||
}
|
||||
string resultsLinePrefix = string.Format("行 {0}: ", item_range.LineNum+1);
|
||||
//int LinePos = item_range.LinePos;
|
||||
//int startPosInLine = item_range.CpMin - LinePos;
|
||||
FindResultsScintilla.IndicatorCurrent = _indicator.Index;
|
||||
FindResultsScintilla.IndicatorFillRange(lastLineStartPos + resultsLinePrefix.Length+1, item_file.Value.Result.CpMax - item_file.Value.Result.CpMin);
|
||||
}
|
||||
}
|
||||
FindResultsScintilla.ReadOnly = true;
|
||||
}
|
||||
|
||||
private void FindResultsScintilla_KeyUp(object sender, KeyEventArgs e)
|
||||
{
|
||||
int pos = FindResultsScintilla.CurrentPosition;
|
||||
int selectedLine = FindResultsScintilla.LineFromPosition(pos);
|
||||
|
||||
if (_findAllResults.ContainsKey(selectedLine))
|
||||
{
|
||||
ScintillaNET_FindReplaceDialog.CharacterRange CharRange = _findAllResults[selectedLine].Result;
|
||||
if (CharRange == null) { return; }
|
||||
if (CharRange.CpMax== CharRange.CpMin) { return; }
|
||||
OnResultClick?.Invoke(this, _findAllResults[selectedLine]);
|
||||
//Scintilla.SetSelection(CharRange.cpMin, CharRange.cpMax);
|
||||
//Scintilla.ScrollCaret();
|
||||
}
|
||||
}
|
||||
|
||||
private void FindResultsScintilla_MouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
int pos = FindResultsScintilla.CharPositionFromPointClose((e.Location).X, (e.Location).Y);
|
||||
if (pos == -1)
|
||||
return;
|
||||
|
||||
int selectedLine = FindResultsScintilla.LineFromPosition(pos);
|
||||
if (_findAllResults.ContainsKey(selectedLine))
|
||||
{
|
||||
ScintillaNET_FindReplaceDialog.CharacterRange CharRange = _findAllResults[selectedLine].Result;
|
||||
if (CharRange == null) { return; }
|
||||
if (CharRange.CpMax == CharRange.CpMin) { return; }
|
||||
OnResultClick?.Invoke(this, _findAllResults[selectedLine]);
|
||||
//Scintilla.SetSelection(CharRange.cpMin, CharRange.cpMax);
|
||||
//Scintilla.ScrollCaret();
|
||||
}
|
||||
}
|
||||
|
||||
private void FindResultsScintilla_MouseDoubleClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
var aa = FindResultsScintilla.CurrentPosition;
|
||||
int selectedLine = FindResultsScintilla.LineFromPosition(aa);
|
||||
//int pos = FindResultsScintilla.CharPositionFromPointClose((e.Location).X, (e.Location).Y);
|
||||
if (selectedLine == -1)
|
||||
return;
|
||||
//int selectedLine = FindResultsScintilla.LineFromPosition(pos);
|
||||
if (_findAllResults.ContainsKey(selectedLine))
|
||||
{
|
||||
ScintillaNET_FindReplaceDialog.CharacterRange CharRange = _findAllResults[selectedLine].Result;
|
||||
if (CharRange == null) { return; }
|
||||
if (CharRange.CpMax == CharRange.CpMin) { return; }
|
||||
OnResultClick?.Invoke(this, _findAllResults[selectedLine]);
|
||||
//Scintilla.SetSelection(CharRange.cpMin, CharRange.cpMax);
|
||||
//Scintilla.ScrollCaret();
|
||||
//Scintilla.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
}
|
||||
public class FindResult
|
||||
{
|
||||
public string Path { get; set; } = "";
|
||||
public ScintillaNET_FindReplaceDialog.CharacterRange Result { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
Reference in new issue
Block a user