Changeset 9999 for stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DataAnalysisSolutionView.cs
- Timestamp:
- 09/23/13 08:08:55 (11 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 9973-9975,9994
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Views
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Views merged: 9973-9974
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/DataAnalysisSolutionView.cs
r9456 r9999 22 22 using System; 23 23 using System.Collections.Generic; 24 using System.ComponentModel; 24 25 using System.Drawing; 25 26 using System.Linq; … … 30 31 using HeuristicLab.Optimization; 31 32 using HeuristicLab.Optimization.Views; 33 using HeuristicLab.PluginInfrastructure; 32 34 33 35 namespace HeuristicLab.Problems.DataAnalysis.Views { 36 34 37 [View("DataAnalysisSolution View")] 35 38 [Content(typeof(DataAnalysisSolution), false)] … … 49 52 addButton.Enabled = false; 50 53 removeButton.Enabled = false; 54 if (Content == null) { 55 exportButton.Enabled = false; 56 } else { 57 exportButton.Enabled = !Locked; 58 } 51 59 } 52 60 … … 117 125 } else 118 126 base.itemsListView_SelectedIndexChanged(sender, e); 127 } 128 129 130 private void exportButton_Click(object sender, EventArgs e) { 131 var exporters = ApplicationManager.Manager.GetInstances<IDataAnalysisSolutionExporter>() 132 .Where(exporter => exporter.Supports(Content)).ToArray(); 133 exportFileDialog.Filter = exporters.Skip(1) 134 .Aggregate(exporters.First().FileTypeFilter, (s, exporter) => s + "|" + exporter.FileTypeFilter); 135 var result = exportFileDialog.ShowDialog(); 136 if (result == DialogResult.OK) { 137 138 var name = exportFileDialog.FileName; 139 var selectedExporter = exporters.Single(exporter => exporter.FileTypeFilter == exportFileDialog.Filter); 140 141 using (BackgroundWorker bg = new BackgroundWorker()) { 142 MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Exportion solution to " + name + "."); 143 bg.DoWork += (_, __) => selectedExporter.Export(Content, name); 144 bg.RunWorkerCompleted += (_, __) => MainFormManager.GetMainForm<MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this); 145 bg.RunWorkerAsync(); 146 } 147 } 119 148 } 120 149
Note: See TracChangeset
for help on using the changeset viewer.