Fondest greetings to all. The 1.0 release is microscopically-near, and you can already savor its features in the latest release candidate. And among these oh-so-savory features is the new step library! In the previous entries, we covered creating steps from your own Controls. But some kinds of steps are so common, we’ve pre-built them for you. For example, choosing one option out of several:
This step took all of one line of code to create (highlighted below):
var choiceStep = new SelectionStep("Color choice",
"Please pick a color", "Red", "Blue", "Green", "Turqoise");
steps.Add(choiceStep);
new WizardController(steps).StartWizard("Hello");
MessageBox.Show((string)choiceStep.Selected);
Once the step has run, you can retrieve the selection via the Selected property.
Next up on our step library hit parade is the file selection step. Patently simple: often you need the user to select a file. This step will do that:
The code to create this step:
"Please provide your license file");
fileStep.Filter = "License Files (.lnc)|*.lnc";
After the step has run, fileStep.SelectedFullPath will return the full path of the selected file.
There’s one more step to cover, but I’ll save it for the next entry. Let me just add that the examples above do not cover every feature and tweak of these steps. We’ll post the complete API reference somewhere after 1.0 is out the door.
No comments:
Post a Comment