1 | using System;
|
---|
2 | using System.Windows.Forms;
|
---|
3 |
|
---|
4 | namespace HeuristicLab.DataPreprocessing.Views {
|
---|
5 | public partial class FindAndReplaceDialog : Form {
|
---|
6 | public FindAndReplaceDialog() {
|
---|
7 | InitializeComponent();
|
---|
8 | string[] cmbItems = { "Value", "Average", "Median", "Random", "Most Common", "Interpolation" };
|
---|
9 | cmbReplaceWith.Items.AddRange(cmbItems);
|
---|
10 | }
|
---|
11 |
|
---|
12 | public void ActivateSearch() {
|
---|
13 | tabSearch.Focus();
|
---|
14 | AddControlsToCurrentTab();
|
---|
15 | }
|
---|
16 |
|
---|
17 | public void ActivateReplace() {
|
---|
18 | tabReplace.Focus();
|
---|
19 | AddControlsToCurrentTab();
|
---|
20 | }
|
---|
21 |
|
---|
22 | private void tabSearchReplace_SelectedIndexChanged(object sender, System.EventArgs e) {
|
---|
23 | AddControlsToCurrentTab();
|
---|
24 | }
|
---|
25 |
|
---|
26 | private void AddControlsToCurrentTab() {
|
---|
27 | tabSearchReplace.SelectedTab.Controls.Add(btnFindAll);
|
---|
28 | tabSearchReplace.SelectedTab.Controls.Add(btnFindNext);
|
---|
29 | tabSearchReplace.SelectedTab.Controls.Add(lblSearch);
|
---|
30 | tabSearchReplace.SelectedTab.Controls.Add(txtSearchString);
|
---|
31 | }
|
---|
32 |
|
---|
33 | public string GetSearchText() {
|
---|
34 | return txtSearchString.Text;
|
---|
35 | }
|
---|
36 |
|
---|
37 | public string GetReplaceText() {
|
---|
38 | return txtValue.Text;
|
---|
39 | }
|
---|
40 |
|
---|
41 | public string GetReplaceAction() {
|
---|
42 | return cmbReplaceWith.SelectedText;
|
---|
43 | }
|
---|
44 |
|
---|
45 | public event EventHandler FindAllEvent {
|
---|
46 | add { btnFindAll.Click += value; }
|
---|
47 | remove { btnFindAll.Click -= value; }
|
---|
48 | }
|
---|
49 |
|
---|
50 | public event EventHandler FindNextEvent {
|
---|
51 | add { btnFindNext.Click += value; }
|
---|
52 | remove { btnFindNext.Click -= value; }
|
---|
53 | }
|
---|
54 |
|
---|
55 | public event EventHandler ReplaceAllEvent {
|
---|
56 | add { btnReplaceAll.Click += value; }
|
---|
57 | remove { btnReplaceAll.Click -= value; }
|
---|
58 | }
|
---|
59 |
|
---|
60 | public event EventHandler ReplaceNextEvent {
|
---|
61 | add { btnReplaceNext.Click += value; }
|
---|
62 | remove { btnReplaceNext.Click -= value; }
|
---|
63 | }
|
---|
64 |
|
---|
65 | }
|
---|
66 | }
|
---|