Free cookie consent management tool by TermsFeed Policy Generator

source: branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.4/DataGridContentView.cs @ 10946

Last change on this file since 10946 was 10946, checked in by sbreuer, 9 years ago
  • always show selected cell
File size: 23.2 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.Collections.Generic;
24using System.Drawing;
25using System.Linq;
26using System.Windows.Forms;
27using HeuristicLab.Data;
28using HeuristicLab.DataPreprocessing.Filter;
29using HeuristicLab.MainForm;
30
31namespace HeuristicLab.DataPreprocessing.Views {
32  [View("Data Grid Content View")]
33  [Content(typeof(IDataGridContent), true)]
34  public partial class DataGridContentView : CopyOfStringConvertibleMatrixView {
35
36    private bool notOwnEvent = true;
37    private bool isSearching = false;
38    private bool isReplacing = false;
39    private bool updateOnMouseUp = false;
40    private SearchAndReplaceDialog findAndReplaceDialog;
41    private IFindPreprocessingItemsIterator searchIterator;
42    private string currentSearchText;
43    private ComparisonOperation currentComparisonOperation;
44    private Tuple<int, int> currentCell;
45
46    public new IDataGridContent Content {
47      get { return (IDataGridContent)base.Content; }
48      set { base.Content = value; }
49    }
50
51    private IList<int> _highlightedRowIndices;
52    public IList<int> HighlightedRowIndices {
53      get { return _highlightedRowIndices; }
54      set {
55        _highlightedRowIndices = value;
56        Refresh();
57      }
58    }
59
60    private IDictionary<int, IList<int>> _highlightedCellsBackground;
61    public IDictionary<int, IList<int>> HightlightedCellsBackground {
62      get { return _highlightedCellsBackground; }
63      set {
64        _highlightedCellsBackground = value;
65        Refresh();
66      }
67    }
68
69    public DataGridContentView() {
70      InitializeComponent();
71      dataGridView.CellMouseClick += dataGridView_CellMouseClick;
72      dataGridView.CellPainting += new System.Windows.Forms.DataGridViewCellPaintingEventHandler(dataGridView_CellPainting);
73      dataGridView.KeyDown += dataGridView_KeyDown;
74      dataGridView.MouseUp += dataGridView_MouseUp;
75      contextMenuCell.Items.Add(ShowHideColumns);
76      _highlightedRowIndices = new List<int>();
77      _highlightedCellsBackground = new Dictionary<int, IList<int>>();
78      currentCell = null;
79    }
80
81    protected override void dataGridView_SelectionChanged(object sender, EventArgs e) {
82      if (Content != null) {
83        if (!isSearching && !isReplacing) {
84
85          if (Control.MouseButtons == MouseButtons.Left) {
86            updateOnMouseUp = true;
87            return;
88          }
89           
90          base.dataGridView_SelectionChanged(sender, e);
91       
92          Content.DataGridLogic.SetSelection(GetSelectedCells());
93        }
94      }
95    }
96
97    private void dataGridView_MouseUp(object sender, MouseEventArgs e) {
98      if (!updateOnMouseUp)
99        return;
100
101      updateOnMouseUp = false;
102      dataGridView_SelectionChanged(sender, e);
103    }                                     
104
105    protected override void OnContentChanged() {
106      base.OnContentChanged();
107      // ToDo: Temporarily disabled because needs to much performance
108      //DataGridView.AutoResizeColumns();
109      //DataGridView.AutoResizeRowHeadersWidth(DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders);
110      DataGridView.RowHeadersWidth = 70;
111      if (Content == null && findAndReplaceDialog != null) {
112        findAndReplaceDialog.Close();
113      }
114    }
115
116    protected override void RegisterContentEvents() {
117      base.RegisterContentEvents();
118      Content.Changed += Content_Changed;
119      Content.FilterLogic.FilterChanged += FilterLogic_FilterChanged;
120    }
121
122    protected override void DeregisterContentEvents() {
123      base.DeregisterContentEvents();
124      Content.Changed -= Content_Changed;
125      Content.FilterLogic.FilterChanged -= FilterLogic_FilterChanged;
126    }
127
128    void FilterLogic_FilterChanged(object sender, EventArgs e) {
129      OnContentChanged();
130      searchIterator = null;
131      if (findAndReplaceDialog != null && !findAndReplaceDialog.IsDisposed) {
132        if (Content.FilterLogic.IsFiltered) {
133          findAndReplaceDialog.DisableReplace();
134        } else {
135          findAndReplaceDialog.EnableReplace();
136        }
137      }
138      btnReplace.Enabled = !Content.FilterLogic.IsFiltered;
139    }
140
141    void Content_Changed(object sender, DataPreprocessingChangedEventArgs e) {
142      if (notOwnEvent) {
143        switch (e.Type) {
144          case DataPreprocessingChangedEventType.ChangeColumn:
145          case DataPreprocessingChangedEventType.ChangeItem:
146            dataGridView.Refresh();
147            break;
148          default:
149            OnContentChanged();
150            break;
151        }
152      }
153      searchIterator = null;
154    }
155
156    protected override void dataGridView_CellValidating(object sender, DataGridViewCellValidatingEventArgs e) {
157      if (!dataGridView.ReadOnly) {
158        string errorMessage;
159        if (Content != null) {
160          if (dataGridView.IsCurrentCellInEditMode && Content.FilterLogic.IsFiltered) {
161            errorMessage = "A filter is active, you cannot modify data. Press ESC to exit edit mode.";
162          } else {
163            Content.DataGridLogic.Validate(e.FormattedValue.ToString(), out errorMessage, e.ColumnIndex);
164          }
165
166          if (!String.IsNullOrEmpty(errorMessage)) {
167            e.Cancel = true;
168            dataGridView.Rows[e.RowIndex].ErrorText = errorMessage;
169          }
170        }
171      }
172    }
173
174    protected override void dataGridView_CellParsing(object sender, DataGridViewCellParsingEventArgs e) {
175      triggersOwnEvent(() => base.dataGridView_CellParsing(sender, e));
176    }
177
178    protected override void PasteValuesToDataGridView() {
179      triggersOwnEvent(() => base.PasteValuesToDataGridView());
180    }
181
182    protected override void SetEnabledStateOfControls() {
183      base.SetEnabledStateOfControls();
184      rowsTextBox.ReadOnly = true;
185      columnsTextBox.ReadOnly = true;
186    }
187
188    private void btnApplySort_Click(object sender, System.EventArgs e) {
189      triggersOwnEvent(() => {
190        Content.ManipulationLogic.ReOrderToIndices(virtualRowIndices);
191        OnContentChanged();
192      });
193    }
194
195    private void triggersOwnEvent(Action action) {
196      notOwnEvent = false;
197      action();
198      notOwnEvent = true;
199    }
200
201    #region FindAndReplaceDialog
202
203    private void CreateFindAndReplaceDialog() {
204      if (findAndReplaceDialog == null || findAndReplaceDialog.IsDisposed) {
205        findAndReplaceDialog = new SearchAndReplaceDialog();
206        findAndReplaceDialog.Show(this);
207        if (AreMultipleCellsSelected()) {
208          ResetHighlightedCellsBackground();
209          HightlightedCellsBackground = GetSelectedCells();
210          dataGridView.ClearSelection();
211        }
212        findAndReplaceDialog.FindAllEvent += findAndReplaceDialog_FindAllEvent;
213        findAndReplaceDialog.FindNextEvent += findAndReplaceDialog_FindNextEvent;
214        findAndReplaceDialog.ReplaceAllEvent += findAndReplaceDialog_ReplaceAllEvent;
215        findAndReplaceDialog.ReplaceNextEvent += findAndReplaceDialog_ReplaceEvent;
216        findAndReplaceDialog.FormClosing += findAndReplaceDialog_FormClosing;
217        searchIterator = null;
218        DataGridView.SelectionChanged += DataGridView_SelectionChanged_FindAndReplace;
219        if (Content.FilterLogic.IsFiltered) {
220          findAndReplaceDialog.DisableReplace();
221        }
222      }
223    }
224
225    private void DataGridView_SelectionChanged_FindAndReplace(object sender, EventArgs e) {
226      if (Content != null) {
227        if (!isSearching && AreMultipleCellsSelected()) {
228          ResetHighlightedCellsBackground();
229          HightlightedCellsBackground = GetSelectedCells();
230          searchIterator = null;
231        }
232      }
233    }
234
235    void findAndReplaceDialog_FormClosing(object sender, FormClosingEventArgs e) {
236      ResetHighlightedCellsBackground();
237      searchIterator = null;
238      DataGridView.SelectionChanged -= DataGridView_SelectionChanged_FindAndReplace;
239    }
240
241    void findAndReplaceDialog_ReplaceEvent(object sender, EventArgs e) {
242      if (searchIterator != null && searchIterator.GetCurrent() != null) {
243        Replace(TransformToDictionary(currentCell));
244      }
245    }
246
247    void findAndReplaceDialog_ReplaceAllEvent(object sender, EventArgs e) {
248      Replace(FindAll(findAndReplaceDialog.GetSearchText()));
249    }
250
251    void findAndReplaceDialog_FindNextEvent(object sender, EventArgs e) {
252      if (searchIterator == null ||
253        currentSearchText != findAndReplaceDialog.GetSearchText() ||
254        currentComparisonOperation != findAndReplaceDialog.GetComparisonOperation()) {
255        searchIterator = new FindPreprocessingItemsIterator(FindAll(findAndReplaceDialog.GetSearchText()));
256        currentSearchText = findAndReplaceDialog.GetSearchText();
257        currentComparisonOperation = findAndReplaceDialog.GetComparisonOperation();
258      }
259
260      if (IsOneCellSelected()) {
261        var first = GetSelectedCells().First();
262        searchIterator.SetStartCell(first.Key, first.Value[0]);
263      }
264
265      bool moreOccurences = false;
266      currentCell = searchIterator.GetCurrent();
267      moreOccurences = searchIterator.MoveNext();
268      if (IsOneCellSelected() && currentCell != null) {
269        var first = GetSelectedCells().First();
270        if (currentCell.Item1 == first.Key && currentCell.Item2 == first.Value[0]) {
271          if (!moreOccurences) {
272            searchIterator.Reset();
273          }
274          currentCell = searchIterator.GetCurrent();
275          moreOccurences = searchIterator.MoveNext();
276          if (!moreOccurences) {
277            searchIterator.Reset();
278          }
279        }
280      }
281
282      dataGridView.ClearSelection();
283
284      if (currentCell != null) {
285        dataGridView[currentCell.Item1, currentCell.Item2].Selected = true;
286        dataGridView.CurrentCell = dataGridView[currentCell.Item1, currentCell.Item2];
287      }
288    }
289
290    private bool AreMultipleCellsSelected() {
291      return GetSelectedCellCount() > 1;
292    }
293
294    private bool IsOneCellSelected() {
295      return GetSelectedCellCount() == 1;
296    }
297
298    private int GetSelectedCellCount() {
299      int count = 0;
300      foreach (var column in GetSelectedCells()) {
301        count += column.Value.Count();
302      }
303      return count;
304    }
305
306    void findAndReplaceDialog_FindAllEvent(object sender, EventArgs e) {
307      dataGridView.ClearSelection();
308      isSearching = true;
309      SuspendRepaint();
310      var selectedCells = FindAll(findAndReplaceDialog.GetSearchText());
311      foreach (var column in selectedCells) {
312        foreach (var cell in column.Value) {
313          dataGridView[column.Key, cell].Selected = true;
314        }
315      }
316      ResumeRepaint(true);
317      isSearching = false;
318      Content.DataGridLogic.SetSelection(selectedCells);
319      //update statistic in base
320      base.dataGridView_SelectionChanged(sender, e);
321    }
322
323    private Core.ConstraintOperation GetConstraintOperation(ComparisonOperation comparisonOperation) {
324      Core.ConstraintOperation constraintOperation = Core.ConstraintOperation.Equal;
325      switch (comparisonOperation) {
326        case ComparisonOperation.Equal:
327          constraintOperation = Core.ConstraintOperation.Equal;
328          break;
329        case ComparisonOperation.Greater:
330          constraintOperation = Core.ConstraintOperation.Greater;
331          break;
332        case ComparisonOperation.GreaterOrEqual:
333          constraintOperation = Core.ConstraintOperation.GreaterOrEqual;
334          break;
335        case ComparisonOperation.Less:
336          constraintOperation = Core.ConstraintOperation.Less;
337          break;
338        case ComparisonOperation.LessOrEqual:
339          constraintOperation = Core.ConstraintOperation.LessOrEqual;
340          break;
341        case ComparisonOperation.NotEqual:
342          constraintOperation = Core.ConstraintOperation.NotEqual;
343          break;
344      }
345      return constraintOperation;
346    }
347
348    private IDictionary<int, IList<int>> FindAll(string match) {
349      bool searchInSelection = HightlightedCellsBackground.Values.Sum(list => list.Count) > 1;
350      ComparisonOperation comparisonOperation = findAndReplaceDialog.GetComparisonOperation();
351      var comparisonFilter = new ComparisonFilter(Content.FilterLogic.PreprocessingData, GetConstraintOperation(comparisonOperation), new StringValue(match), true);
352      var filters = new List<Filter.IFilter>() { comparisonFilter };
353      var foundCells = new Dictionary<int, IList<int>>();
354      for (int i = 0; i < Content.FilterLogic.PreprocessingData.Columns; i++) {
355        comparisonFilter.ConstraintColumn = i;
356        bool[] filteredRows = Content.FilterLogic.GetFilterResult(filters, true);
357        var foundIndices = new List<int>();
358        for (int idx = 0; idx < filteredRows.Length; ++idx) {
359          var notFilteredThusFound = !filteredRows[idx];
360          if (notFilteredThusFound) {
361            foundIndices.Add(idx);
362          }
363        }
364        foundCells[i] = foundIndices;
365        IList<int> selectedList;
366        if (searchInSelection && HightlightedCellsBackground.TryGetValue(i, out selectedList)) {
367          foundCells[i] = foundCells[i].Intersect(selectedList).ToList<int>();
368        } else if (searchInSelection) {
369          foundCells[i].Clear();
370        }
371      }
372      return foundCells;
373    }
374
375    private void Replace(IDictionary<int, IList<int>> cells) {
376      if (findAndReplaceDialog != null) {
377        ReplaceTransaction(() => {
378          switch (findAndReplaceDialog.GetReplaceAction()) {
379            case ReplaceAction.Value:
380              Content.ManipulationLogic.ReplaceIndicesByValue(cells, findAndReplaceDialog.GetReplaceText());
381              break;
382            case ReplaceAction.Average:
383              Content.ManipulationLogic.ReplaceIndicesByAverageValue(cells, false);
384              break;
385            case ReplaceAction.Median:
386              Content.ManipulationLogic.ReplaceIndicesByMedianValue(cells, false);
387              break;
388            case ReplaceAction.Random:
389              Content.ManipulationLogic.ReplaceIndicesByRandomValue(cells, false);
390              break;
391            case ReplaceAction.MostCommon:
392              Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(cells, false);
393              break;
394            case ReplaceAction.Interpolation:
395              Content.ManipulationLogic.ReplaceIndicesByLinearInterpolationOfNeighbours(cells);
396              break;
397          }
398        });
399      }
400    }
401
402    private IDictionary<int, IList<int>> TransformToDictionary(Tuple<int, int> tuple) {
403      var highlightCells = new Dictionary<int, IList<int>>();
404      highlightCells.Add(tuple.Item1, new List<int>() { tuple.Item2 });
405      return highlightCells;
406    }
407
408    private void ResetHighlightedCellsBackground() {
409      HightlightedCellsBackground = new Dictionary<int, IList<int>>();
410    }
411
412    #endregion FindAndReplaceDialog
413
414    private void dataGridView_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) {
415      if (Content == null) return;
416      if (e.Button == System.Windows.Forms.MouseButtons.Right) {
417        if (e.ColumnIndex == -1 || e.RowIndex == -1) {
418          replaceValueOverColumnToolStripMenuItem.Visible = false;
419          contextMenuCell.Show(MousePosition);
420        } else {
421          if (!dataGridView.SelectedCells.Contains(dataGridView[e.ColumnIndex, e.RowIndex])) {
422            dataGridView.ClearSelection();
423            dataGridView[e.ColumnIndex, e.RowIndex].Selected = true;
424          }
425
426          var columnIndices = new HashSet<int>();
427          for (int i = 0; i < dataGridView.SelectedCells.Count; i++) {
428            columnIndices.Add(dataGridView.SelectedCells[i].ColumnIndex);
429          }
430
431          replaceValueOverSelectionToolStripMenuItem.Enabled = AreMultipleCellsSelected();
432
433          averageToolStripMenuItem_Column.Enabled =
434            averageToolStripMenuItem_Selection.Enabled =
435            medianToolStripMenuItem_Column.Enabled =
436            medianToolStripMenuItem_Selection.Enabled =
437            randomToolStripMenuItem_Column.Enabled =
438            randomToolStripMenuItem_Selection.Enabled = !Content.DataGridLogic.AreAllStringColumns(columnIndices);
439
440          smoothingToolStripMenuItem_Column.Enabled =
441            interpolationToolStripMenuItem_Column.Enabled = !dataGridView.SelectedCells.Contains(dataGridView[e.ColumnIndex, 0])
442            && !dataGridView.SelectedCells.Contains(dataGridView[e.ColumnIndex, Content.Rows - 1])
443            && !Content.DataGridLogic.AreAllStringColumns(columnIndices);
444
445          replaceValueOverColumnToolStripMenuItem.Visible = true;
446          contextMenuCell.Show(MousePosition);
447        }
448      }
449    }
450
451    protected void dataGridView_CellPainting(object sender, DataGridViewCellPaintingEventArgs e) {
452      if (Content == null) return;
453      if (e.RowIndex < 0) return;
454      if (e.ColumnIndex < 0) return;
455      if (e.State.HasFlag(DataGridViewElementStates.Selected)) return;
456      if (!e.PaintParts.HasFlag(DataGridViewPaintParts.Background)) return;
457      if (HighlightedRowIndices == null) return;
458
459      int rowIndex = virtualRowIndices[e.RowIndex];
460
461      Color backColor = e.CellStyle.BackColor;
462
463      if (HightlightedCellsBackground.ContainsKey(e.ColumnIndex) && HightlightedCellsBackground[e.ColumnIndex].Contains(e.RowIndex)) {
464        backColor = Color.LightGray;
465      }
466
467      using (Brush backColorBrush = new SolidBrush(backColor)) {
468        Rectangle bounds = new Rectangle(e.CellBounds.X, e.CellBounds.Y, e.CellBounds.Width, e.CellBounds.Height);
469        e.Graphics.FillRectangle(backColorBrush, bounds);
470      }
471
472      using (Brush gridBrush = new SolidBrush(Color.LightGray)) {
473        Pen gridLinePen = new Pen(gridBrush);
474        e.Graphics.DrawLine(gridLinePen, e.CellBounds.Left,
475               e.CellBounds.Bottom - 1, e.CellBounds.Right - 1,
476               e.CellBounds.Bottom - 1);
477        e.Graphics.DrawLine(gridLinePen, e.CellBounds.Right - 1,
478            e.CellBounds.Top, e.CellBounds.Right - 1,
479            e.CellBounds.Bottom);
480      }
481
482      e.PaintContent(e.CellBounds);
483      e.Handled = true;
484    }
485
486    void dataGridView_KeyDown(object sender, KeyEventArgs e) {
487      var selectedRows = dataGridView.SelectedRows;
488      if (e.KeyCode == Keys.Delete && selectedRows.Count > 0) {
489        List<int> rows = new List<int>();
490        for (int i = 0; i < selectedRows.Count; ++i) {
491          rows.Add(selectedRows[i].Index);
492        }
493        triggersOwnEvent(() => {
494          Content.DataGridLogic.DeleteRow(rows);
495          OnContentChanged();
496        });
497      } else if (e.Control && e.KeyCode == Keys.F) {
498        CreateFindAndReplaceDialog();
499        findAndReplaceDialog.ActivateSearch();
500      } else if (e.Control && e.KeyCode == Keys.R) {
501        CreateFindAndReplaceDialog();
502        findAndReplaceDialog.ActivateReplace();
503      }
504    }
505
506    protected override int[] Sort(IEnumerable<KeyValuePair<int, SortOrder>> sortedColumns) {
507      btnApplySort.Enabled = sortedColumns.Any();
508      return base.Sort(sortedColumns);
509    }
510
511    protected override void ClearSorting() {
512      btnApplySort.Enabled = false;
513      base.ClearSorting();
514    }
515
516    private IDictionary<int, IList<int>> GetSelectedCells() {
517      IDictionary<int, IList<int>> selectedCells = new Dictionary<int, IList<int>>();
518      for (int i = 0; i < dataGridView.SelectedCells.Count; i++) {
519        var columnIndex = dataGridView.SelectedCells[i].ColumnIndex;
520        if (!selectedCells.ContainsKey(columnIndex)) {
521          selectedCells.Add(columnIndex, new List<int>());
522        }
523        selectedCells[columnIndex].Add(dataGridView.SelectedCells[i].RowIndex);
524      }
525      return selectedCells;
526    }
527
528    private void StartReplacing() {
529      isReplacing = true;
530      SuspendRepaint();
531    }
532
533    private void StopReplacing() {
534      isReplacing = false;
535      ResumeRepaint(true);
536    }
537
538    private void ReplaceTransaction(Action action) {
539      StartReplacing();
540      action();
541      StopReplacing();
542    }
543
544    private void ReplaceWithAverage_Column_Click(object sender, EventArgs e) {
545      ReplaceTransaction(() => {
546        Content.ManipulationLogic.ReplaceIndicesByAverageValue(GetSelectedCells(), false);
547      });
548    }
549    private void ReplaceWithAverage_Selection_Click(object sender, EventArgs e) {
550      ReplaceTransaction(() => {
551        Content.ManipulationLogic.ReplaceIndicesByAverageValue(GetSelectedCells(), true);
552      });
553    }
554
555    private void ReplaceWithMedian_Column_Click(object sender, EventArgs e) {
556      ReplaceTransaction(() => {
557        Content.ManipulationLogic.ReplaceIndicesByMedianValue(GetSelectedCells(), false);
558      });
559    }
560    private void ReplaceWithMedian_Selection_Click(object sender, EventArgs e) {
561      ReplaceTransaction(() => {
562        Content.ManipulationLogic.ReplaceIndicesByMedianValue(GetSelectedCells(), true);
563      });
564    }
565
566    private void ReplaceWithRandom_Column_Click(object sender, EventArgs e) {
567      ReplaceTransaction(() => {
568        Content.ManipulationLogic.ReplaceIndicesByRandomValue(GetSelectedCells(), false);
569      });
570    }
571    private void ReplaceWithRandom_Selection_Click(object sender, EventArgs e) {
572      ReplaceTransaction(() => {
573        Content.ManipulationLogic.ReplaceIndicesByRandomValue(GetSelectedCells(), true);
574      });
575    }
576
577    private void ReplaceWithMostCommon_Column_Click(object sender, EventArgs e) {
578      ReplaceTransaction(() => {
579        Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(GetSelectedCells(), false);
580      });
581    }
582    private void ReplaceWithMostCommon_Selection_Click(object sender, EventArgs e) {
583      ReplaceTransaction(() => {
584        Content.ManipulationLogic.ReplaceIndicesByMostCommonValue(GetSelectedCells(), true);
585      });
586    }
587
588    private void ReplaceWithInterpolation_Column_Click(object sender, EventArgs e) {
589      ReplaceTransaction(() => {
590        Content.ManipulationLogic.ReplaceIndicesByLinearInterpolationOfNeighbours(GetSelectedCells());
591      });
592    }
593
594    private void ReplaceWithSmoothing_Selection_Click(object sender, EventArgs e) {
595      ReplaceTransaction(() => {
596        Content.ManipulationLogic.ReplaceIndicesBySmoothing(GetSelectedCells());
597      });
598    }
599
600    private void btnSearch_Click(object sender, EventArgs e) {
601      CreateFindAndReplaceDialog();
602      findAndReplaceDialog.ActivateSearch();
603    }
604
605    private void btnReplace_Click(object sender, EventArgs e) {
606      CreateFindAndReplaceDialog();
607      findAndReplaceDialog.ActivateReplace();
608    }
609  }
610}
Note: See TracBrowser for help on using the repository browser.