Changeset 14029 for branches/crossvalidation-2434/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.cs
- Timestamp:
- 07/08/16 14:40:02 (8 years ago)
- Location:
- branches/crossvalidation-2434
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/crossvalidation-2434
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Optimization.Views
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Optimization.Views/3.3/UserDefinedAlgorithmView.cs
r12012 r14029 57 57 base.SetEnabledStateOfControls(); 58 58 globalScopeView.Enabled = Content != null; 59 newOperatorGraphButton.Enabled = Content != null && !ReadOnly;60 openOperatorGraphButton.Enabled = Content != null && !ReadOnly;61 59 operatorGraphViewHost.ReadOnly = Content == null || ReadOnly; 62 }63 64 private void newOperatorGraphButton_Click(object sender, EventArgs e) {65 Content.OperatorGraph = new OperatorGraph();66 }67 private void openOperatorGraphButton_Click(object sender, EventArgs e) {68 openFileDialog.Title = "Open Operator Graph";69 if (openFileDialog.ShowDialog(this) == DialogResult.OK) {70 newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = false;71 operatorGraphViewHost.Enabled = false;72 73 ContentManager.LoadAsync(openFileDialog.FileName, delegate(IStorableContent content, Exception error) {74 try {75 if (error != null) throw error;76 OperatorGraph operatorGraph = content as OperatorGraph;77 if (operatorGraph == null)78 MessageBox.Show(this, "The selected file does not contain an operator graph.", "Invalid File", MessageBoxButtons.OK, MessageBoxIcon.Error);79 else80 Content.OperatorGraph = operatorGraph;81 }82 catch (Exception ex) {83 ErrorHandling.ShowErrorDialog(this, ex);84 }85 finally {86 Invoke(new Action(delegate() {87 operatorGraphViewHost.Enabled = true;88 newOperatorGraphButton.Enabled = openOperatorGraphButton.Enabled = true;89 }));90 }91 });92 }93 60 } 94 61 }
Note: See TracChangeset
for help on using the changeset viewer.