Changeset 8331 for branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.Instances.Views/3.3/ProblemInstanceConsumerViewGeneric.cs
- Timestamp:
- 07/26/12 09:51:13 (12 years ago)
- Location:
- branches/ScatterSearch (trunk integration)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ScatterSearch (trunk integration)
- Property svn:ignore
-
old new 21 21 protoc.exe 22 22 _ReSharper.HeuristicLab 3.3 Tests 23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/ScatterSearch (trunk integration)/HeuristicLab.Problems.Instances.Views/3.3/ProblemInstanceConsumerViewGeneric.cs
r8086 r8331 26 26 using System.Windows.Forms; 27 27 using HeuristicLab.Common.Resources; 28 using HeuristicLab.Core; 28 29 using HeuristicLab.MainForm; 29 30 using HeuristicLab.MainForm.WindowsForms; … … 92 93 problemInstanceProviderComboBox.Enabled = !ReadOnly && !Locked && Content != null && problemInstanceProviderComboBox.Items.Count > 0; 93 94 libraryInfoButton.Enabled = SelectedProvider != null && SelectedProvider.WebLink != null; 94 importButton.Enabled = !ReadOnly && !Locked && Content != null && Consumer != null; 95 exportButton.Enabled = !ReadOnly && !Locked && Content != null && Exporter != null; 96 problemInstanceProviderSplitContainer.Panel2Collapsed = !exportButton.Enabled; 95 importButton.Enabled = !ReadOnly && !Locked && Content != null && Consumer != null && 96 GenericSelectedProvider != null && GenericSelectedProvider.CanImportData; 97 ProviderImportSplitContainer.Panel2Collapsed = !importButton.Enabled; 98 exportButton.Enabled = !ReadOnly && !Locked && Content != null && Exporter != null && 99 GenericSelectedProvider != null && GenericSelectedProvider.CanExportData; 100 ProviderExportSplitContainer.Panel2Collapsed = !exportButton.Enabled; 97 101 } 98 102 … … 131 135 T instance = default(T); 132 136 try { 133 instance = GenericSelectedProvider. LoadData(openFileDialog.FileName);137 instance = GenericSelectedProvider.ImportData(openFileDialog.FileName); 134 138 } 135 139 catch (Exception ex) { … … 146 150 } 147 151 148 protected v oid exportButton_Click(object sender, EventArgs e) {152 protected virtual void exportButton_Click(object sender, EventArgs e) { 149 153 if (saveFileDialog.ShowDialog(this) == DialogResult.OK) { 150 154 try { 151 GenericSelectedProvider. SaveData(GenericExporter.Export(), saveFileDialog.FileName);155 GenericSelectedProvider.ExportData(GenericExporter.Export(), saveFileDialog.FileName); 152 156 } 153 157 catch (Exception ex) { … … 158 162 159 163 protected string GetProblemType() { 164 var item = Content as IItem; 165 if (item != null) 166 return item.ItemName; 167 return "problem"; 168 } 169 protected string GetProviderFormatInfo() { 160 170 return SelectedProvider.Name; 161 171 } … … 164 174 protected void SetTooltip() { 165 175 toolTip.SetToolTip(problemInstanceProviderComboBox, GetProviderToolTip()); 166 toolTip.SetToolTip(importButton, " Open a " + GetProblemType() + " problem from file.");167 toolTip.SetToolTip(exportButton, "Export currently loaded " + GetProblemType() + " problem to a file.");176 toolTip.SetToolTip(importButton, "Import a " + GetProblemType() + " from a file in the " + GetProviderFormatInfo() + " format."); 177 toolTip.SetToolTip(exportButton, "Export currently loaded " + GetProblemType() + " to a file in the " + GetProviderFormatInfo() + " format."); 168 178 if (SelectedProvider.WebLink != null) 169 179 toolTip.SetToolTip(libraryInfoButton, "Browse to " + SelectedProvider.WebLink.ToString());
Note: See TracChangeset
for help on using the changeset viewer.