Free cookie consent management tool by TermsFeed Policy Generator

source: branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/FindAndReplaceDialog.cs @ 10660

Last change on this file since 10660 was 10636, checked in by sbreuer, 11 years ago
  • further enhancements of FilterAndReplaceDialog
File size: 1.8 KB
Line 
1using System;
2using System.Windows.Forms;
3
4namespace 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}
Note: See TracBrowser for help on using the repository browser.