Changeset 4587 for branches/OKB/HeuristicLab.Clients.OKB-3.3/Views
- Timestamp:
- 10/09/10 13:27:57 (14 years ago)
- Location:
- branches/OKB/HeuristicLab.Clients.OKB-3.3/Views
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/AlgorithmDataView.cs
r4558 r4587 157 157 if (Content == null) Content = new AlgorithmData { AlgorithmId = AlgorithmId }; 158 158 viewHost.Content = (IContent)dialog.TypeSelector.CreateInstanceOfSelectedType(); 159 DataType dataType = OKBClient.Instance.DataTypes.FirstOrDefault(d => d.Name == viewHost.Content.GetType().AssemblyQualifiedName); 160 if (dataType == null) { 161 dataType = new DataType { Name = viewHost.Content.GetType().AssemblyQualifiedName, SqlName = "varbinary" }; 162 dataType.PlatformId = OKBClient.Instance.Platforms.FirstOrDefault(p => p.Name == "HeuristicLab 3.3").Id; 163 dataType.Store(); 164 OKBClient.Instance.DataTypes.Add(dataType); 165 dataTypeComboBoxValues = OKBClient.Instance.DataTypes.OrderBy(d => d.Name).ToList(); 166 dataTypeComboBox.DataSource = dataTypeComboBoxValues; 167 } 159 DataType dataType = OKBClient.Instance.ConvertToDataType(viewHost.Content.GetType()); 160 dataTypeComboBoxValues = OKBClient.Instance.DataTypes.OrderBy(d => d.Name).ToList(); 161 dataTypeComboBox.DataSource = dataTypeComboBoxValues; 168 162 dataTypeComboBox.SelectedItem = dataType; 169 163 fileTextBox.Text = "-"; … … 190 184 viewHost.Content = algorithm; 191 185 noViewAvailableLabel.Visible = false; 192 DataType dataType = OKBClient.Instance.DataTypes.FirstOrDefault(d => d.Name == viewHost.Content.GetType().AssemblyQualifiedName); 193 if (dataType == null) { 194 dataType = new DataType { Name = viewHost.Content.GetType().AssemblyQualifiedName, SqlName = "varbinary" }; 195 dataType.PlatformId = OKBClient.Instance.Platforms.FirstOrDefault(p => p.Name == "HeuristicLab 3.3").Id; 196 dataType.Store(); 197 OKBClient.Instance.DataTypes.Add(dataType); 198 dataTypeComboBoxValues = OKBClient.Instance.DataTypes.OrderBy(d => d.Name).ToList(); 199 dataTypeComboBox.DataSource = dataTypeComboBoxValues; 200 } 186 DataType dataType = OKBClient.Instance.ConvertToDataType(viewHost.Content.GetType()); 187 dataTypeComboBoxValues = OKBClient.Instance.DataTypes.OrderBy(d => d.Name).ToList(); 188 dataTypeComboBox.DataSource = dataTypeComboBoxValues; 201 189 dataTypeComboBox.SelectedItem = dataType; 202 190 } else { -
branches/OKB/HeuristicLab.Clients.OKB-3.3/Views/ProblemDataView.cs
r4558 r4587 156 156 if (Content == null) Content = new ProblemData { ProblemId = ProblemId }; 157 157 viewHost.Content = (IContent)dialog.TypeSelector.CreateInstanceOfSelectedType(); 158 DataType dataType = OKBClient.Instance.DataTypes.FirstOrDefault(d => d.Name == viewHost.Content.GetType().AssemblyQualifiedName); 159 if (dataType == null) { 160 dataType = new DataType { Name = viewHost.Content.GetType().AssemblyQualifiedName, SqlName = "varbinary" }; 161 dataType.PlatformId = OKBClient.Instance.Platforms.FirstOrDefault(p => p.Name == "HeuristicLab 3.3").Id; 162 dataType.Store(); 163 OKBClient.Instance.DataTypes.Add(dataType); 164 dataTypeComboBoxValues = OKBClient.Instance.DataTypes.OrderBy(d => d.Name).ToList(); 165 dataTypeComboBox.DataSource = dataTypeComboBoxValues; 166 } 158 DataType dataType = OKBClient.Instance.ConvertToDataType(viewHost.Content.GetType()); 159 dataTypeComboBoxValues = OKBClient.Instance.DataTypes.OrderBy(d => d.Name).ToList(); 160 dataTypeComboBox.DataSource = dataTypeComboBoxValues; 167 161 dataTypeComboBox.SelectedItem = dataType; 168 162 fileTextBox.Text = "-"; … … 189 183 viewHost.Content = problem; 190 184 noViewAvailableLabel.Visible = false; 191 DataType dataType = OKBClient.Instance.DataTypes.FirstOrDefault(d => d.Name == viewHost.Content.GetType().AssemblyQualifiedName); 192 if (dataType == null) { 193 dataType = new DataType { Name = viewHost.Content.GetType().AssemblyQualifiedName, SqlName = "varbinary" }; 194 dataType.PlatformId = OKBClient.Instance.Platforms.FirstOrDefault(p => p.Name == "HeuristicLab 3.3").Id; 195 dataType.Store(); 196 OKBClient.Instance.DataTypes.Add(dataType); 197 dataTypeComboBoxValues = OKBClient.Instance.DataTypes.OrderBy(d => d.Name).ToList(); 198 dataTypeComboBox.DataSource = dataTypeComboBoxValues; 199 } 185 DataType dataType = OKBClient.Instance.ConvertToDataType(viewHost.Content.GetType()); 186 dataTypeComboBoxValues = OKBClient.Instance.DataTypes.OrderBy(d => d.Name).ToList(); 187 dataTypeComboBox.DataSource = dataTypeComboBoxValues; 200 188 dataTypeComboBox.SelectedItem = dataType; 201 189 } else {
Note: See TracChangeset
for help on using the changeset viewer.