Files
ayanova7/source/WinFormApp/LocaleInfoFormSearchAndReplace.cs
2018-06-29 19:47:36 +00:00

243 lines
8.8 KiB
C#

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace AyaNova
{
/// <summary>
/// Summary description for LocaleInfoFormSearchAndReplace.
/// </summary>
public class LocaleInfoFormSearchAndReplace : System.Windows.Forms.Form
{
private Infragistics.Win.Misc.UltraLabel ultraLabel1;
private Infragistics.Win.Misc.UltraLabel ultraLabel2;
private Infragistics.Win.Misc.UltraButton btnReplace;
private Infragistics.Win.Misc.UltraButton btnCancel;
private Infragistics.Win.Misc.UltraButton btnFind;
private Infragistics.Win.UltraWinEditors.UltraTextEditor edFind;
private Infragistics.Win.UltraWinEditors.UltraTextEditor edReplace;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
public LocaleInfoFormSearchAndReplace()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
//
// TODO: Add any constructor code after InitializeComponent call
//
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LocaleInfoFormSearchAndReplace));
this.ultraLabel1 = new Infragistics.Win.Misc.UltraLabel();
this.ultraLabel2 = new Infragistics.Win.Misc.UltraLabel();
this.btnReplace = new Infragistics.Win.Misc.UltraButton();
this.btnCancel = new Infragistics.Win.Misc.UltraButton();
this.btnFind = new Infragistics.Win.Misc.UltraButton();
this.edFind = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
this.edReplace = new Infragistics.Win.UltraWinEditors.UltraTextEditor();
((System.ComponentModel.ISupportInitialize)(this.edFind)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.edReplace)).BeginInit();
this.SuspendLayout();
//
// ultraLabel1
//
this.ultraLabel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ultraLabel1.AutoSize = true;
this.ultraLabel1.Location = new System.Drawing.Point(12, 14);
this.ultraLabel1.Name = "ultraLabel1";
this.ultraLabel1.Size = new System.Drawing.Size(104, 17);
this.ultraLabel1.TabIndex = 1;
this.ultraLabel1.Text = "LT:UI.Label.Find";
//
// ultraLabel2
//
this.ultraLabel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.ultraLabel2.AutoSize = true;
this.ultraLabel2.Location = new System.Drawing.Point(12, 90);
this.ultraLabel2.Name = "ultraLabel2";
this.ultraLabel2.Size = new System.Drawing.Size(127, 17);
this.ultraLabel2.TabIndex = 3;
this.ultraLabel2.Text = "LT:UI.Label.Replace";
//
// btnReplace
//
this.btnReplace.Location = new System.Drawing.Point(12, 168);
this.btnReplace.Name = "btnReplace";
this.btnReplace.Size = new System.Drawing.Size(118, 27);
this.btnReplace.TabIndex = 4;
this.btnReplace.Text = "LT:UI.Label.Replace";
this.btnReplace.Click += new System.EventHandler(this.btnReplace_Click);
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(404, 168);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(118, 27);
this.btnCancel.TabIndex = 5;
this.btnCancel.Text = "LT:UI.Command.Cancel";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnFind
//
this.btnFind.Location = new System.Drawing.Point(208, 168);
this.btnFind.Name = "btnFind";
this.btnFind.Size = new System.Drawing.Size(118, 27);
this.btnFind.TabIndex = 6;
this.btnFind.Text = "LT:UI.Label.Find";
this.btnFind.Click += new System.EventHandler(this.btnFind_Click);
//
// edFind
//
this.edFind.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.edFind.Location = new System.Drawing.Point(11, 37);
this.edFind.Name = "edFind";
this.edFind.Size = new System.Drawing.Size(511, 24);
this.edFind.TabIndex = 7;
//
// edReplace
//
this.edReplace.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.edReplace.Location = new System.Drawing.Point(12, 113);
this.edReplace.Name = "edReplace";
this.edReplace.Size = new System.Drawing.Size(510, 24);
this.edReplace.TabIndex = 8;
//
// LocaleInfoFormSearchAndReplace
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 15);
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(534, 214);
this.ControlBox = false;
this.Controls.Add(this.edReplace);
this.Controls.Add(this.edFind);
this.Controls.Add(this.btnFind);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnReplace);
this.Controls.Add(this.ultraLabel2);
this.Controls.Add(this.ultraLabel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximumSize = new System.Drawing.Size(756, 254);
this.MinimumSize = new System.Drawing.Size(540, 219);
this.Name = "LocaleInfoFormSearchAndReplace";
this.ShowInTaskbar = false;
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Text = "LT:UI.Label.FindAndReplace";
this.Load += new System.EventHandler(this.LocaleInfoFormSearchAndReplace_Load);
((System.ComponentModel.ISupportInitialize)(this.edFind)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.edReplace)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
// __ _ _ ___ ____ __ __ __ __ __ ___ ___
// / _)( )( )/ __)(_ _)/ \( \/ ) / _)/ \( \( _)
// ( (_ )()( \__ \ )( ( () )) ( ( (_( () )) ) )) _)
// \__) \__/ (___/ (__) \__/(_/\/\_) \__)\__/(___/(___)
//
private void LocaleInfoFormSearchAndReplace_Load(object sender, System.EventArgs e)
{
Util.Localize(this);
}
private void btnFind_Click(object sender, System.EventArgs e)
{
bReplaceText=false;
if(FindValue=="")
this.DialogResult=DialogResult.Cancel;
else
this.DialogResult=DialogResult.OK;
this.Close();
}
private void btnReplace_Click(object sender, System.EventArgs e)
{
bReplaceText=true;
if(FindValue=="" || ReplaceValue=="" )
this.DialogResult=DialogResult.Cancel;
else
this.DialogResult=DialogResult.OK;
this.Close();
}
private void btnCancel_Click(object sender, System.EventArgs e)
{
this.DialogResult=DialogResult.Cancel;
this.Close();
}
public string FindValue
{
get{return this.edFind.Text;}
}
public string ReplaceValue
{
get{return this.edReplace.Text;}
}
private bool bReplaceText=false;
public bool ReplaceText
{
get{return bReplaceText;}
}
}
}