Changeset 7347
- Timestamp:
- 01/17/12 16:18:18 (13 years ago)
- Location:
- branches/ChangeDatasetOfRegressionModel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ChangeDatasetOfRegressionModel/HeuristicLab.Core.Views/3.3/ItemCollectionView.cs
r7259 r7347 64 64 if (components != null) components.Dispose(); 65 65 } 66 DeregisterContentEvents(); 66 67 base.Dispose(disposing); 67 68 } … … 93 94 protected override void OnContentChanged() { 94 95 base.OnContentChanged(); 96 foreach (T item in itemListViewItemMapping.Keys) { 97 DeregisterItemEvents(item); 98 } 95 99 itemsListView.Items.Clear(); 96 100 itemListViewItemMapping.Clear(); … … 190 194 T item = listViewItem.Tag as T; 191 195 int i = listViewItem.ImageIndex; 192 itemsListView.SmallImageList.Images[i] = item == null ? HeuristicLab.Common.Resources.VSImageLibrary.Nothing : item.ItemImage; 196 if (itemsListView.SmallImageList != null) { 197 itemsListView.SmallImageList.Images[i] = item == null ? HeuristicLab.Common.Resources.VSImageLibrary.Nothing : item.ItemImage; 198 } else { 199 listViewItem.ImageIndex = -1; 200 } 193 201 listViewItem.ImageIndex = -1; 194 202 listViewItem.ImageIndex = i; -
branches/ChangeDatasetOfRegressionModel/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionSolutionView.cs
r7338 r7347 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.Linq; 25 using System.Text; 24 26 using System.Windows.Forms; 25 27 using HeuristicLab.Core; … … 64 66 ErrorHandling.ShowErrorDialog(this, ex); 65 67 } 68 66 69 IRegressionProblemData problemData = null; 67 70 if (hlFile != null && hlFile is RegressionProblemData) { … … 71 74 } 72 75 if (problemData != null) { 73 IList<string> missingVariables = new List<string>();76 StringBuilder message = new StringBuilder(); 74 77 if (!problemData.TargetVariable.Equals(Content.ProblemData.TargetVariable)) 75 missingVariables.Add(Content.ProblemData.TargetVariable); 78 message.AppendLine("The target variables are not matching. Old target variable: '" + Content.ProblemData.TargetVariable 79 + "'. New targetvariable: '" + problemData.TargetVariable + "'"); 76 80 77 //foreach (var item in Content.ProblemData.InputVariables.CheckedItems) { 78 // if (!problemData.InputVariables.Contains(item.Value)) 79 // missingVariables.Add(item.Value.ToString()); 80 //} 81 List<string> variables = problemData.InputVariables.Select(x => x.Value).ToList(); 81 82 82 //easier solution will be created later83 bool found;84 83 foreach (var item in Content.ProblemData.InputVariables.CheckedItems) { 85 found = false; 86 foreach (var it in problemData.InputVariables) { 87 if (it.Value.Equals(item.Value.Value)) { 88 found = true; 89 break; 90 } 91 } 92 if (!found) 93 missingVariables.Add(item.Value.ToString()); 84 if (!variables.Contains(item.Value.Value)) 85 message.AppendLine("Input variable '" + item.Value.Value + "' is not in the new problem data."); 94 86 } 95 87 96 if (missingVariables.Count != 0) { 97 string message = ""; 98 foreach (var item in missingVariables) { 99 message += item + Environment.NewLine; 100 } 101 ErrorHandling.ShowErrorDialog(this, new Exception(message)); 102 } else { 88 if (message.Length != 0) 89 ErrorHandling.ShowErrorDialog(this, new Exception(message.ToString())); 90 else 103 91 Content.ProblemData = problemData; 104 }105 92 } 106 93 }
Note: See TracChangeset
for help on using the changeset viewer.