Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/tools/Templates/HeuristicLab.VS2010Wizards/AlgorithmWizardForm.cs @ 7271

Last change on this file since 7271 was 4188, checked in by abeham, 14 years ago

#567

  • Started adding problem wizard
File size: 2.5 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Linq;
7using System.Text;
8using System.Windows.Forms;
9
10namespace HeuristicLab.VS2010Wizards {
11  public partial class AlgorithmWizardForm : Form {
12    public string AlgorithmName {
13      get;
14      private set;
15    }
16    public string AlgorithmDescription {
17      get;
18      private set;
19    }
20    public bool IsMultiObjective {
21      get;
22      private set;
23    }
24    public string ParameterProperties {
25      get;
26      private set;
27    }
28    public string Properties {
29      get;
30      private set;
31    }
32    public string ParameterInitializers {
33      get;
34      private set;
35    }
36
37    public AlgorithmWizardForm() {
38      InitializeComponent();
39      parametersControl.AddParameter("SetSeedRandomly", "Value", "BoolValue", "True if the random seed should be set to a random value, otherwise false.", "new BoolValue(true)");
40      parametersControl.AddParameter("Seed", "Value", "IntValue", "The random seed used to initialize the new pseudo random number generator.", string.Empty);
41      parametersControl.AddParameter("Analyzer", "Value", "MultiAnalyzer", "The operator used to analyze each iteration.", "new MultiAnalyzer()");
42    }
43
44    private void finishButton_Click(object sender, System.EventArgs e) {
45      SetProperties();
46      DialogResult = System.Windows.Forms.DialogResult.OK;
47      Close();
48    }
49
50    private void cancelButton_Click(object sender, System.EventArgs e) {
51      DialogResult = System.Windows.Forms.DialogResult.Cancel;
52      Close();
53    }
54
55    private void SetProperties() {
56      AlgorithmName = algorithmNameTextBox.Text;
57      AlgorithmDescription = algorithmDescriptionTextBox.Text;
58      IsMultiObjective = isMultiObjectiveCheckBox.Checked;
59      ParameterProperties = parametersControl.GetParameterProperties("private");
60      Properties = parametersControl.GetProperties("public");
61      ParameterInitializers = parametersControl.GetInitializers();
62    }
63
64    private void nextButton_Click(object sender, EventArgs e) {
65      page1Panel.Visible = false;
66      page2Panel.Visible = true;
67      nextButton.Enabled = false;
68      previousButton.Enabled = true;
69    }
70
71    private void previousButton_Click(object sender, EventArgs e) {
72      page2Panel.Visible = false;
73      page1Panel.Visible = true;
74      previousButton.Enabled = false;
75      nextButton.Enabled = true;
76    }
77  }
78}
Note: See TracBrowser for help on using the repository browser.