Changeset 5641 for branches/QAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/QuadraticAssignmentProblemView.cs
- Timestamp:
- 03/09/11 03:23:32 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/QAP/HeuristicLab.Problems.QuadraticAssignment.Views/3.3/QuadraticAssignmentProblemView.cs
r5583 r5641 20 20 #endregion 21 21 22 using System; 22 23 using System.Windows.Forms; 23 24 using HeuristicLab.Common.Resources; … … 38 39 InitializeComponent(); 39 40 importInstanceButton.Image = VSImageLibrary.Open; 41 Controls.Remove(parameterCollectionView); 42 parameterCollectionView.Dock = DockStyle.Fill; 43 problemTabPage.Controls.Add(parameterCollectionView); 44 } 45 46 protected override void RegisterContentEvents() { 47 base.RegisterContentEvents(); 48 Content.DistanceMatrixParameter.ValueChanged += new EventHandler(DistanceMatrixParameter_ValueChanged); 49 Content.WeightsParameter.ValueChanged += new EventHandler(WeightsParameter_ValueChanged); 50 Content.BestKnownSolutionParameter.ValueChanged += new EventHandler(BestKnownSolutionParameter_ValueChanged); 51 } 52 53 protected override void DeregisterContentEvents() { 54 Content.DistanceMatrixParameter.ValueChanged -= new EventHandler(DistanceMatrixParameter_ValueChanged); 55 Content.WeightsParameter.ValueChanged -= new EventHandler(WeightsParameter_ValueChanged); 56 Content.BestKnownSolutionParameter.ValueChanged -= new EventHandler(BestKnownSolutionParameter_ValueChanged); 57 base.DeregisterContentEvents(); 58 } 59 60 private void DistanceMatrixParameter_ValueChanged(object sender, System.EventArgs e) { 61 qapView.Distances = Content.DistanceMatrix; 62 } 63 64 private void WeightsParameter_ValueChanged(object sender, System.EventArgs e) { 65 qapView.Weights = Content.Weights; 66 } 67 68 private void BestKnownSolutionParameter_ValueChanged(object sender, System.EventArgs e) { 69 qapView.Assignment = Content.BestKnownSolution; 40 70 } 41 71 … … 47 77 instancesComboBox.Items.Add(instance); 48 78 } 79 qapView.Distances = Content.DistanceMatrix; 80 qapView.Weights = Content.Weights; 81 qapView.Assignment = Content.BestKnownSolution; 82 } else { 83 qapView.Distances = null; 84 qapView.Weights = null; 85 qapView.Assignment = null; 49 86 } 50 87 } … … 63 100 private void loadInstanceButton_Click(object sender, System.EventArgs e) { 64 101 string instance = instancesComboBox.SelectedItem as string; 65 Content.LoadEmbeddedInstance(instance); 102 try { 103 Content.LoadEmbeddedInstance(instance); 104 } catch (Exception ex) { 105 PluginInfrastructure.ErrorHandling.ShowErrorDialog(ex); 106 } 66 107 } 67 108 68 109 private void importInstanceButton_Click(object sender, System.EventArgs e) { 69 110 if (openFileDialog.ShowDialog() == DialogResult.OK) { 70 Content.ImportFileInstance(openFileDialog.FileName); 111 try { 112 Content.ImportFileInstance(openFileDialog.FileName); 113 } catch (Exception ex) { 114 PluginInfrastructure.ErrorHandling.ShowErrorDialog(ex); 115 } 71 116 } 72 117 }
Note: See TracChangeset
for help on using the changeset viewer.