Changeset 11420
- Timestamp:
- 10/06/14 16:20:02 (10 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.Instances.VehicleRouting.Views/3.4/VRPInstanceProviderView.cs
r11287 r11420 29 29 namespace HeuristicLab.Problems.Instances.VehicleRouting.Views { 30 30 [View("VRP InstanceProvider View")] 31 [Content(typeof(I ProblemInstanceProvider<IVRPData>), IsDefaultView = true)]31 [Content(typeof(IVRPInstanceProvider<>), IsDefaultView = true)] 32 32 public partial class VRPInstanceProviderView<T> : ProblemInstanceProviderView<T> where T : class, IVRPData { 33 33 … … 37 37 38 38 protected override void importButton_Click(object sender, EventArgs e) { 39 var provider = Content as IVRPInstanceProvider ;39 var provider = Content as IVRPInstanceProvider<T>; 40 40 if (provider != null) { 41 41 using (var dialog = new VRPImportDialog(Content.Name)) { … … 54 54 55 55 protected override void exportButton_Click(object sender, EventArgs e) { 56 var provider = Content as IVRPInstanceProvider ;56 var provider = Content as IVRPInstanceProvider<T>; 57 57 if (provider != null) { 58 58 if (saveFileDialog.ShowDialog(this) == DialogResult.OK) { -
trunk/sources/HeuristicLab.Problems.Instances.VehicleRouting/3.4/IVRPInstanceProvider.cs
r11287 r11420 21 21 22 22 namespace HeuristicLab.Problems.Instances.VehicleRouting { 23 public interface IVRPInstanceProvider {23 public interface IVRPInstanceProvider<T> { 24 24 bool CanImportData { get; } 25 IVRPDataImport(string vrpFile, string tourFile);25 T Import(string vrpFile, string tourFile); 26 26 27 27 bool CanExportData { get; } 28 void Export( IVRPDatainstance, string path);28 void Export(T instance, string path); 29 29 } 30 30 } -
trunk/sources/HeuristicLab.Problems.Instances.VehicleRouting/3.4/VRPInstanceProvider.cs
r11295 r11420 29 29 30 30 namespace HeuristicLab.Problems.Instances.VehicleRouting { 31 public abstract class VRPInstanceProvider<T> : ProblemInstanceProvider<T>, IVRPInstanceProvider where T : IVRPData {31 public abstract class VRPInstanceProvider<T> : ProblemInstanceProvider<T>, IVRPInstanceProvider<T> where T : IVRPData { 32 32 protected abstract string FileName { get; } 33 33 … … 114 114 protected abstract T LoadData(Stream stream); 115 115 116 public IVRPDataImport(string vrpFile, string tourFile) {116 public T Import(string vrpFile, string tourFile) { 117 117 var data = ImportData(vrpFile); 118 118 if (!String.IsNullOrEmpty(tourFile)) { … … 122 122 } 123 123 124 public void Export( IVRPDatainstance, string path) {125 ExportData( (T)instance, path);124 public void Export(T instance, string path) { 125 ExportData(instance, path); 126 126 } 127 127
Note: See TracChangeset
for help on using the changeset viewer.