Changeset 4185 for trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VehicleRoutingProblemView.cs
- Timestamp:
- 08/10/10 11:32:52 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.3/VehicleRoutingProblemView.cs
r4068 r4185 24 24 using HeuristicLab.MainForm; 25 25 using HeuristicLab.Optimization.Views; 26 using HeuristicLab.Core.Views; 27 using HeuristicLab.Core; 26 28 27 29 namespace HeuristicLab.Problems.VehicleRouting.Views { 28 30 [View("VehicleRouting Problem View")] 29 31 [Content(typeof(VehicleRoutingProblem), true)] 30 public partial class VehicleRoutingProblemView : ProblemView {32 public partial class VehicleRoutingProblemView : NamedItemView { 31 33 public new VehicleRoutingProblem Content { 32 34 get { return (VehicleRoutingProblem)base.Content; } … … 36 38 public VehicleRoutingProblemView() { 37 39 InitializeComponent(); 40 } 41 42 protected override void DeregisterContentEvents() { 43 Content.CoordinatesParameter.ValueChanged -= new EventHandler(CoordinatesParameter_ValueChanged); 44 base.DeregisterContentEvents(); 45 } 46 protected override void RegisterContentEvents() { 47 base.RegisterContentEvents(); 48 Content.CoordinatesParameter.ValueChanged += new EventHandler(CoordinatesParameter_ValueChanged); 49 } 50 51 protected override void OnContentChanged() { 52 base.OnContentChanged(); 53 if (Content == null) { 54 parameterCollectionView.Content = null; 55 vrpSolutionView.Content = null; 56 } else { 57 parameterCollectionView.Content = ((IParameterizedNamedItem)Content).Parameters; 58 vrpSolutionView.Content = new VRPSolution(Content.Coordinates); 59 } 60 } 61 62 protected override void SetEnabledStateOfControls() { 63 base.SetEnabledStateOfControls(); 64 parameterCollectionView.Enabled = Content != null; 65 vrpSolutionView.Enabled = Content != null; 66 importButton.Enabled = Content != null && !ReadOnly; 38 67 } 39 68 … … 46 75 } 47 76 } 77 78 private void CoordinatesParameter_ValueChanged(object sender, EventArgs e) { 79 vrpSolutionView.Content.Coordinates = Content.Coordinates; 80 } 48 81 } 49 82 }
Note: See TracChangeset
for help on using the changeset viewer.