Changeset 11205 for branches/HiveStatistics/sources/HeuristicLab.Problems.Instances.TSPLIB.Views/3.3/TSPLIBTSPInstanceProviderView.cs
- Timestamp:
- 07/18/14 13:44:53 (10 years ago)
- Location:
- branches/HiveStatistics/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HiveStatistics/sources
- Property svn:ignore
-
old new 8 8 FxCopResults.txt 9 9 Google.ProtocolBuffers-0.9.1.dll 10 Google.ProtocolBuffers-2.4.1.473.dll 10 11 HeuristicLab 3.3.5.1.ReSharper.user 11 12 HeuristicLab 3.3.6.0.ReSharper.user 12 13 HeuristicLab.4.5.resharper.user 13 14 HeuristicLab.ExtLibs.6.0.ReSharper.user 15 HeuristicLab.Scripting.Development 14 16 HeuristicLab.resharper.user 15 17 ProtoGen.exe … … 17 19 _ReSharper.HeuristicLab 18 20 _ReSharper.HeuristicLab 3.3 21 _ReSharper.HeuristicLab 3.3 Tests 19 22 _ReSharper.HeuristicLab.ExtLibs 20 23 bin 21 24 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests23 Google.ProtocolBuffers-2.4.1.473.dll
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/HiveStatistics/sources/HeuristicLab.Problems.Instances.TSPLIB.Views
- Property svn:mergeinfo changed
-
branches/HiveStatistics/sources/HeuristicLab.Problems.Instances.TSPLIB.Views/3.3/TSPLIBTSPInstanceProviderView.cs
r11203 r11205 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 2Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 24 24 using System.Windows.Forms; 25 25 using HeuristicLab.MainForm; 26 using HeuristicLab.MainForm.WindowsForms;27 26 using HeuristicLab.Problems.Instances.Views; 28 27 29 28 namespace HeuristicLab.Problems.Instances.TSPLIB.Views { 30 29 [View("TSPLIB TSP InstanceProvider View")] 31 [Content(typeof( IProblemInstanceConsumer<TSPData>), IsDefaultView = true)]32 public partial class TSPLIBTSPInstanceProviderView : ProblemInstance ConsumerViewGeneric<TSPData> {33 public new IProblemInstanceConsumer<TSPData>Content {34 get { return ( IProblemInstanceConsumer<TSPData>)base.Content; }30 [Content(typeof(TSPLIBTSPInstanceProvider), IsDefaultView = true)] 31 public partial class TSPLIBTSPInstanceProviderView : ProblemInstanceProviderView<TSPData> { 32 public new TSPLIBTSPInstanceProvider Content { 33 get { return (TSPLIBTSPInstanceProvider)base.Content; } 35 34 set { base.Content = value; } 36 35 } … … 41 40 42 41 protected override void importButton_Click(object sender, EventArgs e) { 43 TSPLIBTSPInstanceProvider provider = SelectedProvider as TSPLIBTSPInstanceProvider; 44 if (provider != null) { 45 using (var dialog = new TSPLIBImportDialog()) { 46 if (dialog.ShowDialog() == DialogResult.OK) { 47 var instance = provider.LoadData(dialog.TSPFileName, dialog.TourFileName, dialog.Quality); 48 try { 49 GenericConsumer.Load(instance); 50 } 51 catch (Exception ex) { 52 MessageBox.Show(String.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(openFileDialog.FileName), Environment.NewLine + ex.Message), "Cannot load instance"); 53 } 42 using (var dialog = new TSPLIBImportDialog()) { 43 if (dialog.ShowDialog() == DialogResult.OK) { 44 var instance = Content.LoadData(dialog.TSPFileName, dialog.TourFileName, dialog.Quality); 45 try { 46 GenericConsumer.Load(instance); 47 instancesComboBox.SelectedIndex = -1; 48 } catch (Exception ex) { 49 MessageBox.Show(String.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(openFileDialog.FileName), Environment.NewLine + ex.Message), "Cannot load instance"); 54 50 } 55 51 } 56 } else {57 base.importButton_Click(sender, e);58 52 } 59 53 }
Note: See TracChangeset
for help on using the changeset viewer.