Changeset 10698 for branches/DataPreprocessing
- Timestamp:
- 04/02/14 12:27:46 (11 years ago)
- Location:
- branches/DataPreprocessing
- Files:
-
- 4 added
- 4 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/DataPreprocessing/HeuristicLab.Core/3.3/Constraints/ComparisonConstraint.cs
r9456 r10698 37 37 } 38 38 public ComparisonConstraint(IItem constrainedValue, ConstraintOperation comparisonOperation, object comparisonValue, bool active) 39 : base(constrainedValue, comparisonOperation, comparison Operation, active) {39 : base(constrainedValue, comparisonOperation, comparisonValue, active) { 40 40 } 41 41 -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/DataGridContentView.cs
r10672 r10698 35 35 private bool notOwnEvent = true; 36 36 private FindAndReplaceDialog findAndReplaceDialog; 37 private IDictionary<int, IList<int>> foundCells; 38 private Tuple<int, int> currentCell; 37 private IFindPreprocessingItemsIterator searchIterator; 39 38 private string currentSearchText; 40 39 … … 142 141 } 143 142 144 143 #region FindAndReplaceDialog 145 144 146 145 private void CreateFindAndReplaceDialog() { 147 146 findAndReplaceDialog = new FindAndReplaceDialog(); 148 findAndReplaceDialog.Show( );147 findAndReplaceDialog.Show(this); 149 148 findAndReplaceDialog.FindAllEvent += findAndReplaceDialog_FindAllEvent; 150 149 findAndReplaceDialog.FindNextEvent += findAndReplaceDialog_FindNextEvent; 151 150 findAndReplaceDialog.ReplaceAllEvent += findAndReplaceDialog_ReplaceAllEvent; 152 151 findAndReplaceDialog.ReplaceNextEvent += findAndReplaceDialog_ReplaceEvent; 153 foundCells = null;154 currentCell = null;155 152 } 156 153 157 154 void findAndReplaceDialog_ReplaceEvent(object sender, EventArgs e) { 158 if ( foundCells!= null)155 if (searchIterator != null && searchIterator.GetCurrent() != null) 159 156 { 160 Replace( GetIndexOfCurrentSelectedCell());157 Replace(TransformToDictionary(searchIterator.GetCurrent())); 161 158 } 162 159 } … … 167 164 168 165 void findAndReplaceDialog_FindNextEvent(object sender, EventArgs e) { 169 IDictionary<int, IList<int>> highlightCell; 170 do { 171 if (foundCells == null || currentSearchText != findAndReplaceDialog.GetSearchText()) { 172 currentSearchText = findAndReplaceDialog.GetSearchText(); 173 foundCells = FindAll(findAndReplaceDialog.GetSearchText()); 174 currentCell = new Tuple<int, int>(0, 0); 175 } else { 176 if (currentCell.Item2 < foundCells[currentCell.Item1].Count - 1) { 177 currentCell = new Tuple<int, int>(currentCell.Item1, currentCell.Item2 + 1); 178 } else if (currentCell.Item1 < foundCells.Count - 1) { 179 currentCell = new Tuple<int, int>(currentCell.Item1 + 1, 0); 180 } else { 181 currentCell = new Tuple<int, int>(0, 0); 182 } 183 } 184 185 highlightCell = GetIndexOfCurrentSelectedCell(); 186 187 } while (!Content.GetValue(currentCell.Item1, highlightCell[currentCell.Item1].ElementAt(0)).Equals(currentSearchText)); 188 HightlightedCells = highlightCell; 166 if (searchIterator == null || currentSearchText != findAndReplaceDialog.GetSearchText()) { 167 searchIterator = new FindPreprocessingItemsIterator(FindAll(findAndReplaceDialog.GetSearchText())); 168 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()); 177 } else { 178 HightlightedCells.Clear(); 179 } 189 180 } 190 181 … … 233 224 } 234 225 235 private IDictionary<int, IList<int>> GetIndexOfCurrentSelectedCell() {226 private IDictionary<int, IList<int>> TransformToDictionary(Tuple<int, int> tuple) { 236 227 var highlightCells = new Dictionary<int, IList<int>>(); 237 int highlightCell = foundCells[currentCell.Item1].ElementAt(currentCell.Item2); 238 highlightCells.Add(currentCell.Item1, new List<int>() { highlightCell }); 228 highlightCells.Add(tuple.Item1, new List<int>() { tuple.Item2 }); 239 229 return highlightCells; 240 230 } 231 232 #endregion FindAndReplaceDialog 241 233 242 234 private void dataGridView_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing.Views/3.3/HeuristicLab.DataPreprocessing.Views-3.3.csproj
r10697 r10698 141 141 <DependentUpon>TransformationView.cs</DependentUpon> 142 142 </Compile> 143 <Compile Include="Utils\FindPreprocessingItemsIterator.cs" /> 144 <Compile Include="Utils\IFindPreprocessingItemsIterator.cs" /> 143 145 <Compile Include="ViewShortcutCollectionView.cs"> 144 146 <SubType>UserControl</SubType> -
branches/DataPreprocessing/HeuristicLab.DataPreprocessing/3.3/HeuristicLab.DataPreprocessing-3.3.csproj
r10694 r10698 75 75 <Compile Include="Implementations\PreprocessingData.cs" /> 76 76 <Compile Include="Implementations\DataGridLogic.cs" /> 77 <Compile Include=" Implementations\DataPreprocessingChangedEvent.cs" />77 <Compile Include="Utils\DataPreprocessingChangedEvent.cs" /> 78 78 <Compile Include="Implementations\Filter\ComparisonFilter.cs" /> 79 79 <Compile Include="Implementations\Filter\IFilter.cs" />
Note: See TracChangeset
for help on using the changeset viewer.