2using System.Windows.Forms;
13 InitializeComponent();
21 InitializeComponent();
33 cboSize.SelectedIndex = 0;
37 cboSize.SelectedIndex = 1;
41 cboSize.SelectedIndex = 2;
46 rbLowFat.Checked =
true;
49 rbRegularCream.Checked =
true;
52 rbVeganCream.Checked =
true;
55 chkCaffeine.Checked = !
mData.DeCaffeinated;
58 rbLotsOfIce.Checked =
true;
62 rbLowIce.Checked =
true;
64 lblDevName.Text =
mData.DevInEditor?.Name ??
"(not set)";
81 switch (cboSize.SelectedIndex)
93 mData.MuchIce = rbLotsOfIce.Checked;
94 mData.DeCaffeinated = !chkCaffeine.Checked;
95 if (rbVeganCream.Checked)
99 else if (rbRegularCream.Checked)
Example task implementations. Since there are lots of things that can be done from a task,...
Provides an editor for the BrewFrappuccino-Task's "Composition" information.
FrappuccinoCompositionEditor()
FrappuccinoCompositionEditor(BrewFrappuccino.CompositionData theData)
Initialize from a given composition object.
readonly BrewFrappuccino.CompositionData mData
void CopyDataToGui()
Let the GUI reflect our data.
void btnOK_Click(object sender, EventArgs e)
Update our data object.
void FrappuccinoCompositionEditor_Shown(object sender, EventArgs e)
If we set the controls' values from the constructor, sometimes they don't get updated properly.
void CopyGuItoData()
When the user clicked on OK, we want to push the state represented by the GUI into our composition ob...
A task working on a complex parameter set.
CreamType
Enum properties result in nice drop-down lists.
Let's pretend the composition is really complex and better done with a custom editor.