internal void Initialize(string selectedText, FindReplaceDialogHelper findHelper) { textBoxFind.Text = selectedText; //if we are searching for the same thing, then keep the replace text the same. if (selectedText == findHelper.FindText) textBoxReplace.Text = findHelper.ReplaceText; textBoxFind.SelectAll(); _left = findHelper.WindowPositionLeft; _top = findHelper.WindowPositionTop; if (findHelper.FindType == FindType.RegEx) radioButtonRegEx.Checked = true; else if (findHelper.FindType == FindType.CaseSensitive) radioButtonCaseSensitive.Checked = true; else radioButtonNormal.Checked = true; }
internal void Initialize(string selectedText, FindReplaceDialogHelper findHelper) { if (Configuration.Settings.Tools.FindHistory.Count > 0) { textBoxFind.Visible = false; comboBoxFind.Visible = true; comboBoxFind.Text = selectedText; comboBoxFind.SelectAll(); comboBoxFind.Items.Clear(); for (int index = 0; index < Configuration.Settings.Tools.FindHistory.Count; index++) { string s = Configuration.Settings.Tools.FindHistory[index]; comboBoxFind.Items.Add(s); } } else { comboBoxFind.Visible = false; textBoxFind.Visible = true; textBoxFind.Text = selectedText; textBoxFind.SelectAll(); } if (findHelper != null) { FindType = findHelper.FindType; } }