diff --git a/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/Commands/FindNextStringCommand.cs b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/Commands/FindNextStringCommand.cs
new file mode 100644
index 0000000..b972cff
--- /dev/null
+++ b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/Commands/FindNextStringCommand.cs
@@ -0,0 +1,75 @@
+#region License
+
+// Copyright 2005-2019 Paul Kohler (https://github.com/paulkohler/minisqlquery). All rights reserved.
+// This source code is made available under the terms of the GNU Lesser General Public License v3.0
+// https://github.com/paulkohler/minisqlquery/blob/master/LICENSE
+#endregion
+
+using System.Windows.Forms;
+using MiniSqlQuery.Core;
+using MiniSqlQuery.Core.Commands;
+
+namespace MiniSqlQuery.PlugIns.SearchTools.Commands
+{
+ /// <summary>The find next string command.</summary>
+ public class FindNextStringCommand : CommandBase
+ {
+ /// <summary>Initializes a new instance of the <see cref="FindNextStringCommand"/> class.</summary>
+ public FindNextStringCommand() : base("Find Next String")
+ {
+ SmallImage = ImageResource.find;
+ ShortcutKeys = Keys.F3;
+ }
+
+ /// <summary>Two execution methods - through the "Find Text" window or by hitting F3.
+ /// If simply hitting F3, we are executing the current search from current cursor position for this window.
+ /// Different windows can also have different search text.</summary>
+ public override void Execute()
+ {
+ IFindReplaceProvider editorFindProvider = HostWindow.ActiveChildForm as IFindReplaceProvider;
+
+ if (editorFindProvider != null)
+ {
+ FindTextRequest findTextRequest = null;
+ int key = editorFindProvider.GetHashCode();
+
+ // is there a request in the table for this window?
+ if (SearchToolsCommon.FindReplaceTextRequests.ContainsKey(key))
+ {
+ findTextRequest = SearchToolsCommon.FindReplaceTextRequests[key];
+ }
+ else
+ {
+ if (SearchToolsCommon.FindReplaceTextRequests.Count > 0)
+ {
+ // if there is an entry in the list of searches create an instance
+ findTextRequest = new FindTextRequest(editorFindProvider);
+ findTextRequest.Position = editorFindProvider.CursorOffset;
+ }
+ else
+ {
+ // none in table, default to curently selected text if its the editor
+ IEditor editor = ActiveFormAsEditor;
+ if (editor != null && editor.SelectedText.Length > 0)
+ {
+ findTextRequest = new FindTextRequest(editorFindProvider, editor.SelectedText);
+ findTextRequest.Position = editorFindProvider.CursorOffset;
+ }
+ }
+ }
+
+ if (findTextRequest != null)
+ {
+ // wrap around to start if at last pos
+ if (findTextRequest.Position != 0)
+ {
+ findTextRequest.Position = editorFindProvider.CursorOffset;
+ }
+
+ findTextRequest = editorFindProvider.TextFindService.FindNext(findTextRequest);
+ SearchToolsCommon.FindReplaceTextRequests[key] = findTextRequest;
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/Commands/ReplaceStringCommand.cs b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/Commands/ReplaceStringCommand.cs
new file mode 100644
index 0000000..a7c38de
--- /dev/null
+++ b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/Commands/ReplaceStringCommand.cs
@@ -0,0 +1,54 @@
+#region License
+
+// Copyright 2005-2019 Paul Kohler (https://github.com/paulkohler/minisqlquery). All rights reserved.
+// This source code is made available under the terms of the GNU Lesser General Public License v3.0
+// https://github.com/paulkohler/minisqlquery/blob/master/LICENSE
+#endregion
+
+using MiniSqlQuery.Core;
+using MiniSqlQuery.Core.Commands;
+
+namespace MiniSqlQuery.PlugIns.SearchTools.Commands
+{
+ /// <summary>The replace string command.</summary>
+ public class ReplaceStringCommand : CommandBase
+ {
+ /// <summary>Initializes a new instance of the <see cref="ReplaceStringCommand"/> class.</summary>
+ public ReplaceStringCommand()
+ : base("Replace String")
+ {
+ }
+
+ /// <summary>Execute the command.</summary>
+ public override void Execute()
+ {
+ IFindReplaceProvider editorFindProvider = HostWindow.ActiveChildForm as IFindReplaceProvider;
+
+ if (editorFindProvider != null)
+ {
+ FindTextRequest req = null;
+ int key = editorFindProvider.GetHashCode();
+
+ // is there a request in the table for this window?
+ if (SearchToolsCommon.FindReplaceTextRequests.ContainsKey(key))
+ {
+ req = SearchToolsCommon.FindReplaceTextRequests[key];
+ }
+
+ if (req != null)
+ {
+ // wrap around to start if at last pos
+ if (req.Position != 0)
+ {
+ req.Position = editorFindProvider.CursorOffset;
+ }
+
+ if (editorFindProvider.ReplaceString(req.ReplaceValue, req.Position - req.SearchValue.Length, req.SearchValue.Length))
+ {
+ CommandManager.GetCommandInstance<FindNextStringCommand>().Execute();
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/Commands/ShowFindTextFormCommand.cs b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/Commands/ShowFindTextFormCommand.cs
new file mode 100644
index 0000000..f27c357
--- /dev/null
+++ b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/Commands/ShowFindTextFormCommand.cs
@@ -0,0 +1,64 @@
+#region License
+
+// Copyright 2005-2019 Paul Kohler (https://github.com/paulkohler/minisqlquery). All rights reserved.
+// This source code is made available under the terms of the GNU Lesser General Public License v3.0
+// https://github.com/paulkohler/minisqlquery/blob/master/LICENSE
+#endregion
+
+using System.Windows.Forms;
+using MiniSqlQuery.Core;
+using MiniSqlQuery.Core.Commands;
+
+namespace MiniSqlQuery.PlugIns.SearchTools.Commands
+{
+ /// <summary>The show find text form command.</summary>
+ public class ShowFindTextFormCommand : CommandBase
+ {
+ /// <summary>Initializes a new instance of the <see cref="ShowFindTextFormCommand"/> class.</summary>
+ public ShowFindTextFormCommand()
+ : base("&Find Text...")
+ {
+ SmallImage = ImageResource.find;
+ ShortcutKeys = Keys.Control | Keys.F;
+ }
+
+
+ /// <summary>Gets a value indicating whether Enabled.</summary>
+ public override bool Enabled
+ {
+ get { return HostWindow.ActiveChildForm is IFindReplaceProvider; }
+ }
+
+ /// <summary>Gets FindReplaceWindow.</summary>
+ public IFindReplaceWindow FindReplaceWindow { get; private set; }
+
+ /// <summary>Execute the command.</summary>
+ public override void Execute()
+ {
+ if (!Enabled)
+ {
+ return;
+ }
+
+ // if the window is an editor, grab the highlighted text
+ IFindReplaceProvider findReplaceProvider = HostWindow.ActiveChildForm as IFindReplaceProvider;
+
+ if (FindReplaceWindow == null || FindReplaceWindow.IsDisposed)
+ {
+ FindReplaceWindow = new FindReplaceForm(Services);
+ }
+
+ if (findReplaceProvider is IEditor)
+ {
+ FindReplaceWindow.FindString = ((IEditor)findReplaceProvider).SelectedText;
+ }
+
+ FindReplaceWindow.TopMost = true;
+
+ if (!FindReplaceWindow.Visible)
+ {
+ FindReplaceWindow.Show(HostWindow.Instance);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/Commands/ShowGoToLineFormCommand.cs b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/Commands/ShowGoToLineFormCommand.cs
new file mode 100644
index 0000000..88158bd
--- /dev/null
+++ b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/Commands/ShowGoToLineFormCommand.cs
@@ -0,0 +1,40 @@
+#region License
+
+// Copyright 2005-2019 Paul Kohler (https://github.com/paulkohler/minisqlquery). All rights reserved.
+// This source code is made available under the terms of the GNU Lesser General Public License v3.0
+// https://github.com/paulkohler/minisqlquery/blob/master/LICENSE
+#endregion
+
+using System.Windows.Forms;
+using MiniSqlQuery.Core;
+using MiniSqlQuery.Core.Commands;
+
+namespace MiniSqlQuery.PlugIns.SearchTools.Commands
+{
+ /// <summary>The show go to line form command.</summary>
+ public class ShowGoToLineFormCommand : CommandBase
+ {
+ /// <summary>Initializes a new instance of the <see cref="ShowGoToLineFormCommand"/> class.</summary>
+ public ShowGoToLineFormCommand()
+ : base("Go To Line...")
+ {
+ ShortcutKeys = Keys.Control | Keys.G;
+ }
+
+ /// <summary>Gets a value indicating whether Enabled.</summary>
+ public override bool Enabled
+ {
+ get { return HostWindow.ActiveChildForm is INavigatableDocument; }
+ }
+
+ /// <summary>Execute the command.</summary>
+ public override void Execute()
+ {
+ if (Enabled)
+ {
+ GoToLineForm frm = Services.Resolve<GoToLineForm>();
+ frm.ShowDialog(HostWindow as Form);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/FindReplaceForm.cs b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/FindReplaceForm.cs
new file mode 100644
index 0000000..c0b17ce
--- /dev/null
+++ b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/FindReplaceForm.cs
@@ -0,0 +1,212 @@
+#region License
+
+// Copyright 2005-2019 Paul Kohler (https://github.com/paulkohler/minisqlquery). All rights reserved.
+// This source code is made available under the terms of the GNU Lesser General Public License v3.0
+// https://github.com/paulkohler/minisqlquery/blob/master/LICENSE
+#endregion
+
+using System;
+using System.Media;
+using System.Windows.Forms;
+using MiniSqlQuery.Core;
+using MiniSqlQuery.PlugIns.SearchTools.Commands;
+
+namespace MiniSqlQuery.PlugIns.SearchTools
+{
+ /// <summary>The find replace form.</summary>
+ public partial class FindReplaceForm : Form, IFindReplaceWindow
+ {
+ /// <summary>The _services.</summary>
+ private readonly IApplicationServices _services;
+
+ /// <summary>Initializes a new instance of the <see cref="FindReplaceForm"/> class.</summary>
+ /// <param name="services">The services.</param>
+ public FindReplaceForm(IApplicationServices services)
+ {
+ InitializeComponent();
+ StartPosition = FormStartPosition.CenterParent;
+ _services = services;
+ }
+
+ /// <summary>Gets or sets FindString.</summary>
+ public string FindString
+ {
+ get { return txtFindString.Text; }
+ set { txtFindString.Text = value; }
+ }
+
+ /// <summary>Gets or sets ReplaceString.</summary>
+ public string ReplaceString
+ {
+ get { return txtReplaceText.Text; }
+ set { txtReplaceText.Text = value; }
+ }
+
+ /// <summary>The create find request.</summary>
+ /// <param name="provider">The provider.</param>
+ /// <param name="findString">The find string.</param>
+ /// <param name="replaceValue">The replace value.</param>
+ private void CreateFindRequest(IFindReplaceProvider provider, string findString, string replaceValue)
+ {
+ int key = provider.GetHashCode();
+ FindTextRequest request;
+
+ if (SearchToolsCommon.FindReplaceTextRequests.ContainsKey(key))
+ {
+ request = SearchToolsCommon.FindReplaceTextRequests[key];
+ if (request.SearchValue != findString)
+ {
+ // reset find text and set the starting position to the current cursor location
+ request.SearchValue = findString;
+ request.ReplaceValue = replaceValue;
+ request.Position = provider.CursorOffset;
+ }
+ }
+ else
+ {
+ request = new FindTextRequest(provider, findString);
+ request.ReplaceValue = replaceValue;
+ }
+
+ SearchToolsCommon.FindReplaceTextRequests[key] = request;
+ }
+
+ /// <summary>The dim form.</summary>
+ private void DimForm()
+ {
+ Opacity = 0.8;
+ }
+
+ /// <summary>The find replace form_ activated.</summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="e">The e.</param>
+ private void FindReplaceForm_Activated(object sender, EventArgs e)
+ {
+ if (txtFindString.Focused | txtReplaceText.Focused)
+ {
+ UnDimForm();
+ }
+ else
+ {
+ DimForm();
+ }
+ }
+
+ /// <summary>The find replace form_ deactivate.</summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="e">The e.</param>
+ private void FindReplaceForm_Deactivate(object sender, EventArgs e)
+ {
+ DimForm();
+ }
+
+ /// <summary>The find replace form_ form closing.</summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="e">The e.</param>
+ private void FindReplaceForm_FormClosing(object sender, FormClosingEventArgs e)
+ {
+ if (e.CloseReason == CloseReason.UserClosing)
+ {
+ e.Cancel = true;
+ Hide();
+ }
+ }
+
+ /// <summary>The find replace form_ key up.</summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="e">The e.</param>
+ private void FindReplaceForm_KeyUp(object sender, KeyEventArgs e)
+ {
+ // simulate close
+ if (e.KeyCode == Keys.Escape)
+ {
+ e.Handled = true;
+ Hide();
+ }
+ }
+
+
+ /// <summary>The handle find next.</summary>
+ /// <param name="provider">The provider.</param>
+ /// <param name="findString">The find string.</param>
+ /// <param name="replaceValue">The replace value.</param>
+ private void HandleFindNext(IFindReplaceProvider provider, string findString, string replaceValue)
+ {
+ CreateFindRequest(provider, findString, replaceValue);
+ CommandManager.GetCommandInstance<FindNextStringCommand>().Execute();
+ }
+
+ /// <summary>The handle replace next.</summary>
+ /// <param name="provider">The provider.</param>
+ /// <param name="findString">The find string.</param>
+ /// <param name="replaceValue">The replace value.</param>
+ private void HandleReplaceNext(IFindReplaceProvider provider, string findString, string replaceValue)
+ {
+ CommandManager.GetCommandInstance<ReplaceStringCommand>().Execute();
+ }
+
+ /// <summary>The un dim form.</summary>
+ private void UnDimForm()
+ {
+ Opacity = 1.0;
+ }
+
+ /// <summary>The btn cancel_ click.</summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="e">The e.</param>
+ private void btnCancel_Click(object sender, EventArgs e)
+ {
+ Hide();
+ }
+
+ /// <summary>The btn find next_ click.</summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="e">The e.</param>
+ private void btnFindNext_Click(object sender, EventArgs e)
+ {
+ IFindReplaceProvider provider = _services.HostWindow.ActiveChildForm as IFindReplaceProvider;
+
+ if (provider == null)
+ {
+ SystemSounds.Beep.Play();
+ }
+ else
+ {
+ HandleFindNext(provider, FindString, ReplaceString);
+ }
+ }
+
+ /// <summary>The btn replace_ click.</summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="e">The e.</param>
+ private void btnReplace_Click(object sender, EventArgs e)
+ {
+ IFindReplaceProvider provider = _services.HostWindow.ActiveChildForm as IFindReplaceProvider;
+
+ if (provider == null)
+ {
+ SystemSounds.Beep.Play();
+ }
+ else
+ {
+ HandleReplaceNext(provider, FindString, ReplaceString);
+ }
+ }
+
+ /// <summary>The txt find string_ enter.</summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="e">The e.</param>
+ private void txtFindString_Enter(object sender, EventArgs e)
+ {
+ UnDimForm();
+ }
+
+ /// <summary>The txt find string_ leave.</summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="e">The e.</param>
+ private void txtFindString_Leave(object sender, EventArgs e)
+ {
+ DimForm();
+ }
+ }
+}
\ No newline at end of file
diff --git a/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/FindReplaceForm.designer.cs b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/FindReplaceForm.designer.cs
new file mode 100644
index 0000000..6d1cb20
--- /dev/null
+++ b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/FindReplaceForm.designer.cs
@@ -0,0 +1,154 @@
+namespace MiniSqlQuery.PlugIns.SearchTools
+{
+ partial class FindReplaceForm
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this.txtFindString = new System.Windows.Forms.TextBox();
+ this.btnFindNext = new System.Windows.Forms.Button();
+ this.btnCancel = new System.Windows.Forms.Button();
+ this.txtReplaceText = new System.Windows.Forms.TextBox();
+ this.btnReplace = new System.Windows.Forms.Button();
+ this.label2 = new System.Windows.Forms.Label();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(12, 15);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(56, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "&Search for";
+ //
+ // txtFindString
+ //
+ this.txtFindString.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtFindString.Location = new System.Drawing.Point(95, 12);
+ this.txtFindString.Name = "txtFindString";
+ this.txtFindString.Size = new System.Drawing.Size(222, 20);
+ this.txtFindString.TabIndex = 1;
+ this.txtFindString.Leave += new System.EventHandler(this.txtFindString_Leave);
+ this.txtFindString.Enter += new System.EventHandler(this.txtFindString_Enter);
+ //
+ // btnFindNext
+ //
+ this.btnFindNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnFindNext.Location = new System.Drawing.Point(161, 64);
+ this.btnFindNext.Name = "btnFindNext";
+ this.btnFindNext.Size = new System.Drawing.Size(75, 23);
+ this.btnFindNext.TabIndex = 10;
+ this.btnFindNext.Text = "&Find Next";
+ this.btnFindNext.UseVisualStyleBackColor = true;
+ this.btnFindNext.Click += new System.EventHandler(this.btnFindNext_Click);
+ //
+ // btnCancel
+ //
+ this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.btnCancel.Location = new System.Drawing.Point(242, 93);
+ this.btnCancel.Name = "btnCancel";
+ this.btnCancel.Size = new System.Drawing.Size(75, 23);
+ this.btnCancel.TabIndex = 12;
+ this.btnCancel.Text = "&Cancel";
+ this.btnCancel.UseVisualStyleBackColor = true;
+ this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
+ //
+ // txtReplaceText
+ //
+ this.txtReplaceText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.txtReplaceText.Location = new System.Drawing.Point(95, 38);
+ this.txtReplaceText.Name = "txtReplaceText";
+ this.txtReplaceText.Size = new System.Drawing.Size(222, 20);
+ this.txtReplaceText.TabIndex = 3;
+ this.txtReplaceText.Leave += new System.EventHandler(this.txtFindString_Leave);
+ this.txtReplaceText.Enter += new System.EventHandler(this.txtFindString_Enter);
+ //
+ // btnReplace
+ //
+ this.btnReplace.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this.btnReplace.Location = new System.Drawing.Point(242, 64);
+ this.btnReplace.Name = "btnReplace";
+ this.btnReplace.Size = new System.Drawing.Size(75, 23);
+ this.btnReplace.TabIndex = 11;
+ this.btnReplace.Text = "&Replace";
+ this.btnReplace.UseVisualStyleBackColor = true;
+ this.btnReplace.Click += new System.EventHandler(this.btnReplace_Click);
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(12, 41);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(69, 13);
+ this.label2.TabIndex = 2;
+ this.label2.Text = "&Replace with";
+ //
+ // FindReplaceForm
+ //
+ this.AcceptButton = this.btnFindNext;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CancelButton = this.btnCancel;
+ this.ClientSize = new System.Drawing.Size(329, 124);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.btnReplace);
+ this.Controls.Add(this.txtReplaceText);
+ this.Controls.Add(this.btnCancel);
+ this.Controls.Add(this.btnFindNext);
+ this.Controls.Add(this.txtFindString);
+ this.Controls.Add(this.label1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
+ this.MinimumSize = new System.Drawing.Size(320, 110);
+ this.Name = "FindReplaceForm";
+ this.Opacity = 0.8;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "Find Text";
+ this.Deactivate += new System.EventHandler(this.FindReplaceForm_Deactivate);
+ this.Activated += new System.EventHandler(this.FindReplaceForm_Activated);
+ this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.FindReplaceForm_KeyUp);
+ this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FindReplaceForm_FormClosing);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox txtFindString;
+ private System.Windows.Forms.Button btnFindNext;
+ private System.Windows.Forms.Button btnCancel;
+ private System.Windows.Forms.TextBox txtReplaceText;
+ private System.Windows.Forms.Button btnReplace;
+ private System.Windows.Forms.Label label2;
+ }
+}
+
diff --git a/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/FindReplaceForm.resx b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/FindReplaceForm.resx
new file mode 100644
index 0000000..19dc0dd
--- /dev/null
+++ b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/FindReplaceForm.resx
@@ -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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/GoToLineForm.cs b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/GoToLineForm.cs
new file mode 100644
index 0000000..be94bcc
--- /dev/null
+++ b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/GoToLineForm.cs
@@ -0,0 +1,76 @@
+#region License
+
+// Copyright 2005-2019 Paul Kohler (https://github.com/paulkohler/minisqlquery). All rights reserved.
+// This source code is made available under the terms of the GNU Lesser General Public License v3.0
+// https://github.com/paulkohler/minisqlquery/blob/master/LICENSE
+#endregion
+
+using System;
+using System.Media;
+using System.Windows.Forms;
+using MiniSqlQuery.Core;
+
+namespace MiniSqlQuery.PlugIns.SearchTools
+{
+ /// <summary>The go to line form.</summary>
+ public partial class GoToLineForm : Form
+ {
+ /// <summary>The _services.</summary>
+ private readonly IApplicationServices _services;
+
+ /// <summary>Initializes a new instance of the <see cref="GoToLineForm"/> class.</summary>
+ /// <param name="services">The services.</param>
+ public GoToLineForm(IApplicationServices services)
+ {
+ _services = services;
+ InitializeComponent();
+ }
+
+ /// <summary>Gets or sets LineValue.</summary>
+ public string LineValue
+ {
+ get { return txtLine.Text; }
+ set { txtLine.Text = value; }
+ }
+
+ /// <summary>The go to line form_ load.</summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="e">The e.</param>
+ private void GoToLineForm_Load(object sender, EventArgs e)
+ {
+ INavigatableDocument navDoc = _services.HostWindow.ActiveChildForm as INavigatableDocument;
+ if (navDoc != null)
+ {
+ LineValue = (navDoc.CursorLine + 1).ToString();
+ Text = string.Format("{0} (1-{1})", Text, navDoc.TotalLines);
+ }
+ }
+
+ /// <summary>The btn ok_ click.</summary>
+ /// <param name="sender">The sender.</param>
+ /// <param name="e">The e.</param>
+ private void btnOk_Click(object sender, EventArgs e)
+ {
+ INavigatableDocument navDoc = _services.HostWindow.ActiveChildForm as INavigatableDocument;
+ if (navDoc != null)
+ {
+ int line;
+
+ if (int.TryParse(LineValue, out line))
+ {
+ int column = 0;
+ line = Math.Abs(line - 1);
+
+ // todo - copy column?
+ if (navDoc.SetCursorByLocation(line, column))
+ {
+ Close();
+ }
+ }
+
+ // otherwise
+ SystemSounds.Beep.Play();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/GoToLineForm.designer.cs b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/GoToLineForm.designer.cs
new file mode 100644
index 0000000..e1b4401
--- /dev/null
+++ b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/GoToLineForm.designer.cs
@@ -0,0 +1,102 @@
+namespace MiniSqlQuery.PlugIns.SearchTools
+{
+ partial class GoToLineForm
+ {
+ /// <summary>
+ /// Required designer variable.
+ /// </summary>
+ private System.ComponentModel.IContainer components = null;
+
+ /// <summary>
+ /// Clean up any resources being used.
+ /// </summary>
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ /// <summary>
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ /// </summary>
+ private void InitializeComponent()
+ {
+ this.lblLinePrompt = new System.Windows.Forms.Label();
+ this.txtLine = new System.Windows.Forms.TextBox();
+ this.btnOk = new System.Windows.Forms.Button();
+ this.btnCancel = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // lblLinePrompt
+ //
+ this.lblLinePrompt.AutoSize = true;
+ this.lblLinePrompt.Location = new System.Drawing.Point(12, 9);
+ this.lblLinePrompt.Name = "lblLinePrompt";
+ this.lblLinePrompt.Size = new System.Drawing.Size(30, 13);
+ this.lblLinePrompt.TabIndex = 0;
+ this.lblLinePrompt.Text = "&Line:";
+ //
+ // txtLine
+ //
+ this.txtLine.Location = new System.Drawing.Point(12, 25);
+ this.txtLine.Name = "txtLine";
+ this.txtLine.Size = new System.Drawing.Size(300, 20);
+ this.txtLine.TabIndex = 1;
+ //
+ // btnOk
+ //
+ this.btnOk.Location = new System.Drawing.Point(156, 51);
+ this.btnOk.Name = "btnOk";
+ this.btnOk.Size = new System.Drawing.Size(75, 23);
+ this.btnOk.TabIndex = 2;
+ this.btnOk.Text = "OK";
+ this.btnOk.UseVisualStyleBackColor = true;
+ this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
+ //
+ // btnCancel
+ //
+ this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.btnCancel.Location = new System.Drawing.Point(237, 51);
+ this.btnCancel.Name = "btnCancel";
+ this.btnCancel.Size = new System.Drawing.Size(75, 23);
+ this.btnCancel.TabIndex = 3;
+ this.btnCancel.Text = "Cancel";
+ this.btnCancel.UseVisualStyleBackColor = true;
+ //
+ // GoToLineForm
+ //
+ this.AcceptButton = this.btnOk;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CancelButton = this.btnCancel;
+ this.ClientSize = new System.Drawing.Size(324, 86);
+ this.Controls.Add(this.btnCancel);
+ this.Controls.Add(this.btnOk);
+ this.Controls.Add(this.txtLine);
+ this.Controls.Add(this.lblLinePrompt);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
+ this.Name = "GoToLineForm";
+ this.Opacity = 0.8;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "Go to Line";
+ this.Load += new System.EventHandler(this.GoToLineForm_Load);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label lblLinePrompt;
+ private System.Windows.Forms.TextBox txtLine;
+ private System.Windows.Forms.Button btnOk;
+ private System.Windows.Forms.Button btnCancel;
+ }
+}
\ No newline at end of file
diff --git a/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/GoToLineForm.resx b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/GoToLineForm.resx
new file mode 100644
index 0000000..19dc0dd
--- /dev/null
+++ b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/GoToLineForm.resx
@@ -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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root>
\ No newline at end of file
diff --git a/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/SearchToolsCommon.cs b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/SearchToolsCommon.cs
new file mode 100644
index 0000000..3024e0a
--- /dev/null
+++ b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/SearchToolsCommon.cs
@@ -0,0 +1,25 @@
+#region License
+
+// Copyright 2005-2019 Paul Kohler (https://github.com/paulkohler/minisqlquery). All rights reserved.
+// This source code is made available under the terms of the GNU Lesser General Public License v3.0
+// https://github.com/paulkohler/minisqlquery/blob/master/LICENSE
+#endregion
+
+using System.Collections.Generic;
+using MiniSqlQuery.Core;
+
+namespace MiniSqlQuery.PlugIns.SearchTools
+{
+ /// <summary>The search tools common.</summary>
+ public class SearchToolsCommon
+ {
+ /// <summary>The _find text requests.</summary>
+ private static readonly Dictionary<int, FindTextRequest> _findTextRequests = new Dictionary<int, FindTextRequest>();
+
+ /// <summary>Gets FindReplaceTextRequests.</summary>
+ public static Dictionary<int, FindTextRequest> FindReplaceTextRequests
+ {
+ get { return _findTextRequests; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/SearchToolsLoader.cs b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/SearchToolsLoader.cs
new file mode 100644
index 0000000..80062f4
--- /dev/null
+++ b/minisqlquery-master/src/MiniSqlQuery/PlugIns/SearchTools/SearchToolsLoader.cs
@@ -0,0 +1,50 @@
+#region License
+
+// Copyright 2005-2019 Paul Kohler (https://github.com/paulkohler/minisqlquery). All rights reserved.
+// This source code is made available under the terms of the GNU Lesser General Public License v3.0
+// https://github.com/paulkohler/minisqlquery/blob/master/LICENSE
+#endregion
+
+using System.Windows.Forms;
+using MiniSqlQuery.Core;
+using MiniSqlQuery.PlugIns.SearchTools.Commands;
+
+namespace MiniSqlQuery.PlugIns.SearchTools
+{
+ /// <summary>The search tools loader.</summary>
+ public class SearchToolsLoader : PluginLoaderBase
+ {
+ /// <summary>Initializes a new instance of the <see cref="SearchToolsLoader"/> class.</summary>
+ public SearchToolsLoader()
+ : base(
+ "Mini SQL Query Search Tools",
+ "Text searching tools - generic find text tool window.",
+ 50)
+ {
+ }
+
+ /// <summary>Iinitialize the plug in.</summary>
+ public override void InitializePlugIn()
+ {
+ Services.RegisterComponent<GoToLineForm>("GoToLineForm");
+
+ ToolStripMenuItem editMenu = Services.HostWindow.GetMenuItem("edit");
+
+ // add the find to the plugins menu
+ editMenu.DropDownItems.Add(CommandControlBuilder.CreateToolStripMenuItem<ShowFindTextFormCommand>());
+ editMenu.DropDownItems.Add(CommandControlBuilder.CreateToolStripMenuItem<FindNextStringCommand>());
+ editMenu.DropDownItems.Add(CommandControlBuilder.CreateToolStripMenuItem<ReplaceStringCommand>());
+ editMenu.DropDownItems.Add(CommandControlBuilder.CreateToolStripMenuItem<ShowGoToLineFormCommand>());
+
+ // get the new item and make in invisible - the shortcut key is still available etc ;-)
+ ToolStripItem item = editMenu.DropDownItems["FindNextStringCommandToolStripMenuItem"];
+ item.Visible = false;
+ item = editMenu.DropDownItems["ReplaceStringCommandToolStripMenuItem"];
+ item.Visible = false;
+
+ // append the button the the toolbar items
+ Services.HostWindow.AddToolStripSeperator(null);
+ Services.HostWindow.AddToolStripCommand<ShowFindTextFormCommand>(null);
+ }
+ }
+}
\ No newline at end of file