Changeset 10719
- Timestamp:
- 04/02/14 16:13:55 (11 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataGridContentView.cs
r10712 r10719 26 26 using System.Windows.Forms; 27 27 using HeuristicLab.Data; 28 using HeuristicLab.DataPreprocessing.Filter; 28 29 using HeuristicLab.MainForm; 29 30 … … 58 59 set { 59 60 _highlightedCells = value; 61 Refresh(); 62 } 63 } 64 65 private IDictionary<int, IList<int>> _highlightedCellsBackground; 66 public IDictionary<int, IList<int>> HightlightedCellsBackground { 67 get { return _highlightedCellsBackground; } 68 set { 69 _highlightedCellsBackground = value; 60 70 Refresh(); 61 71 } … … 70 80 _highlightedCells = new Dictionary<int, IList<int>>(); 71 81 _highlightedRowIndices = new List<int>(); 82 _highlightedCellsBackground = new Dictionary<int, IList<int>>(); 72 83 currentCell = null; 73 84 } … … 147 158 findAndReplaceDialog = new FindAndReplaceDialog(); 148 159 findAndReplaceDialog.Show(this); 160 HightlightedCellsBackground = GetSelectedCells(); 161 dataGridView.ClearSelection(); 149 162 findAndReplaceDialog.FindAllEvent += findAndReplaceDialog_FindAllEvent; 150 163 findAndReplaceDialog.FindNextEvent += findAndReplaceDialog_FindNextEvent; … … 156 169 void findAndReplaceDialog_FormClosing(object sender, FormClosingEventArgs e) { 157 170 ResetHighlightedCells(); 171 ResetHighlightedCellsBackground(); 158 172 } 159 173 … … 188 202 if (!moreOccurences) { 189 203 searchIterator.Reset(); 190 ResetHighlightedCells();191 204 } 192 205 } … … 194 207 void findAndReplaceDialog_FindAllEvent(object sender, EventArgs e) { 195 208 HightlightedCells = FindAll(findAndReplaceDialog.GetSearchText()); 209 searchIterator.Reset(); 196 210 } 197 211 198 212 private IDictionary<int, IList<int>> FindAll(string match) { 199 var comparisonFilter = new Filter.ComparisonFilter(Content.FilterLogic.PreprocessingData, Core.ConstraintOperation.Equal, new StringValue(match), true); 213 bool searchInSelection = HightlightedCellsBackground.Values.Sum(list => list.Count) > 1; 214 var comparisonFilter = new ComparisonFilter(Content.FilterLogic.PreprocessingData, Core.ConstraintOperation.Equal, new StringValue(match), true); 200 215 var filters = new List<Filter.IFilter>() { comparisonFilter }; 201 216 var foundCells = new Dictionary<int, IList<int>>(); … … 207 222 .Select(pair => pair.Index) 208 223 .ToList(); 224 IList<int> selectedList; 225 if (searchInSelection && HightlightedCellsBackground.TryGetValue(i, out selectedList)) { 226 foundCells[i].Intersect(selectedList); 227 } else { 228 foundCells[i].Clear(); 229 } 209 230 } 210 231 return foundCells; … … 244 265 private void ResetHighlightedCells() { 245 266 HightlightedCells = new Dictionary<int, IList<int>>(); 267 } 268 269 private void ResetHighlightedCellsBackground() { 270 HightlightedCellsBackground = new Dictionary<int, IList<int>>(); 246 271 } 247 272 … … 284 309 Color backColor = e.CellStyle.BackColor; 285 310 311 if (HightlightedCellsBackground.ContainsKey(e.ColumnIndex) && HightlightedCellsBackground[e.ColumnIndex].Contains(e.RowIndex)) { 312 backColor = Color.LightGray; 313 } 286 314 if (HighlightedRowIndices.Contains(rowIndex) || HightlightedCells.ContainsKey(e.ColumnIndex) && HightlightedCells[e.ColumnIndex].Contains(e.RowIndex)) { 287 backColor = Color. Pink;315 backColor = Color.LightGreen; 288 316 } 289 317 -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/Utils/FindPreprocessingItemsIterator.cs
r10705 r10719 76 76 return result; 77 77 } 78 79 //private bool EndReached() {80 // bool result = true;81 // if (items != null && CurrentCellExists()) {82 // result = currentCell.Item1 >= items.Count - 1 && currentCell.Item2 >= items[currentCell.Item1].Count - 1;83 // }84 // return result;85 //}86 78 } 87 79 }
Note: See TracChangeset
for help on using the changeset viewer.