- Timestamp:
- 04/02/14 13:47:19 (11 years ago)
- Location:
- branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataGridContentView.cs
r10698 r10705 150 150 findAndReplaceDialog.ReplaceAllEvent += findAndReplaceDialog_ReplaceAllEvent; 151 151 findAndReplaceDialog.ReplaceNextEvent += findAndReplaceDialog_ReplaceEvent; 152 findAndReplaceDialog.FormClosing += findAndReplaceDialog_FormClosing; 153 } 154 155 void findAndReplaceDialog_FormClosing(object sender, FormClosingEventArgs e) { 156 ResetHighlightedCells(); 152 157 } 153 158 … … 161 166 void findAndReplaceDialog_ReplaceAllEvent(object sender, EventArgs e) { 162 167 Replace(FindAll(findAndReplaceDialog.GetSearchText())); 168 findAndReplaceDialog.SetEndReached(false); 163 169 } 164 170 … … 167 173 searchIterator = new FindPreprocessingItemsIterator(FindAll(findAndReplaceDialog.GetSearchText())); 168 174 currentSearchText = findAndReplaceDialog.GetSearchText(); 169 } 170 171 while (searchIterator.MoveNext() && (searchIterator.GetCurrent() == null || !Content.GetValue(searchIterator.GetCurrent().Item1, searchIterator.GetCurrent().Item2).Equals(currentSearchText))) { 172 173 } 174 175 if (searchIterator.GetCurrent() != null) { 176 HightlightedCells = TransformToDictionary(searchIterator.GetCurrent()); 175 findAndReplaceDialog.SetEndReached(false); 176 } 177 178 Tuple<int, int> currentCell = null; 179 bool moreOccurences = false; 180 do { 181 currentCell = searchIterator.GetCurrent(); 182 moreOccurences = searchIterator.MoveNext(); 183 } while (moreOccurences && (currentCell == null || !Content.GetValue(currentCell.Item2, currentCell.Item1).Equals(currentSearchText))); 184 185 if (!moreOccurences) { 186 findAndReplaceDialog.SetEndReached(true); 187 } 188 189 if (currentCell != null) { 190 HightlightedCells = TransformToDictionary(currentCell); 177 191 } else { 178 HightlightedCells.Clear();192 ResetHighlightedCells(); 179 193 } 180 194 } … … 182 196 void findAndReplaceDialog_FindAllEvent(object sender, EventArgs e) { 183 197 HightlightedCells = FindAll(findAndReplaceDialog.GetSearchText()); 198 findAndReplaceDialog.SetEndReached(false); 184 199 } 185 200 … … 228 243 highlightCells.Add(tuple.Item1, new List<int>() { tuple.Item2 }); 229 244 return highlightCells; 245 } 246 247 private void ResetHighlightedCells() { 248 HightlightedCells = new Dictionary<int, IList<int>>(); 230 249 } 231 250 -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/FindAndReplaceDialog.Designer.cs
r10672 r10705 37 37 this.txtValue = new System.Windows.Forms.TextBox(); 38 38 this.label1 = new System.Windows.Forms.Label(); 39 this.lblEndReached = new System.Windows.Forms.Label(); 39 40 this.tabSearchReplace.SuspendLayout(); 40 41 this.tabReplace.SuspendLayout(); … … 51 52 this.tabSearchReplace.Name = "tabSearchReplace"; 52 53 this.tabSearchReplace.SelectedIndex = 0; 53 this.tabSearchReplace.Size = new System.Drawing.Size(564, 1 35);54 this.tabSearchReplace.Size = new System.Drawing.Size(564, 143); 54 55 this.tabSearchReplace.TabIndex = 0; 55 56 this.tabSearchReplace.SelectedIndexChanged += new System.EventHandler(this.tabSearchReplace_SelectedIndexChanged); … … 67 68 // tabReplace 68 69 // 70 this.tabReplace.Controls.Add(this.lblEndReached); 69 71 this.tabReplace.Controls.Add(this.txtSearchString); 70 72 this.tabReplace.Controls.Add(this.lblSearch); … … 80 82 this.tabReplace.Name = "tabReplace"; 81 83 this.tabReplace.Padding = new System.Windows.Forms.Padding(3); 82 this.tabReplace.Size = new System.Drawing.Size(556, 1 09);84 this.tabReplace.Size = new System.Drawing.Size(556, 117); 83 85 this.tabReplace.TabIndex = 1; 84 86 this.tabReplace.Text = "Replace"; … … 172 174 this.label1.Text = "Replace with"; 173 175 // 176 // lblEndReached 177 // 178 this.lblEndReached.AutoSize = true; 179 this.lblEndReached.Location = new System.Drawing.Point(218, 100); 180 this.lblEndReached.Name = "lblEndReached"; 181 this.lblEndReached.Size = new System.Drawing.Size(139, 13); 182 this.lblEndReached.TabIndex = 24; 183 this.lblEndReached.Text = "No more occurences found."; 184 // 174 185 // FindAndReplaceDialog 175 186 // 176 187 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 177 188 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 178 this.ClientSize = new System.Drawing.Size(588, 1 59);189 this.ClientSize = new System.Drawing.Size(588, 167); 179 190 this.Controls.Add(this.tabSearchReplace); 180 191 this.Name = "FindAndReplaceDialog"; … … 202 213 private System.Windows.Forms.TextBox txtValue; 203 214 private System.Windows.Forms.Label label1; 215 private System.Windows.Forms.Label lblEndReached; 204 216 } 205 217 } -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/FindAndReplaceDialog.cs
r10672 r10705 20 20 cmbReplaceWith.Items.AddRange(cmbItemsText); 21 21 cmbReplaceWith.SelectedIndex = (int)ReplaceAction.Value; 22 SetEndReached(false); 22 23 } 23 24 … … 30 31 tabReplace.Focus(); 31 32 AddControlsToCurrentTab(); 33 } 34 35 public void SetEndReached(bool endReached) { 36 lblEndReached.Visible = endReached; 32 37 } 33 38 … … 45 50 tabSearchReplace.SelectedTab.Controls.Add(lblSearch); 46 51 tabSearchReplace.SelectedTab.Controls.Add(txtSearchString); 52 tabSearchReplace.SelectedTab.Controls.Add(lblEndReached); 47 53 } 48 54 -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/Utils/FindPreprocessingItemsIterator.cs
r10698 r10705 37 37 public bool MoveNext() { 38 38 bool result = false; 39 bool endReached = false; 39 40 if (items != null) { 40 41 do { … … 43 44 } else if (currentCell.Item1 < items.Count - 1) { 44 45 currentCell = new Tuple<int, int>(currentCell.Item1 + 1, 0); 46 } else { 47 endReached = true; 45 48 } 46 } while (! EndReached()&& !CurrentCellExists());47 result = EndReached();49 } while (!endReached && !CurrentCellExists()); 50 result = !endReached; 48 51 } 49 52 return result; … … 61 64 public void Reset() { 62 65 currentCell = new Tuple<int, int>(0, 0); 66 if (!CurrentCellExists()) { 67 MoveNext(); 68 } 63 69 } 64 70 … … 71 77 } 72 78 73 private bool EndReached() {74 bool result = true;75 if (items != null && CurrentCellExists()) {76 result = currentCell.Item1 >= items.Count - 1 && currentCell.Item2 >= items[currentCell.Item1].Count - 1;77 }78 return result;79 }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 //} 80 86 } 81 87 }
Note: See TracChangeset
for help on using the changeset viewer.