If you have a comment on this topic, contact Aptify Documentation. If you want to return to the Aptify Community Site, please click here.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The following steps provide an overview of how to write a new code wizard for Aptify:
Info: If using the template provided by Aptify for this project, configure the template as described in "Loading the Sample Code and Templates" in the Developer Guide, rename the project and form class, and skip to Step 5

  1. Open a new Class Library project in Visual Studio.
  2. Select Project > Add Windows Form... from the Visual Studio menu to add a Windows form to the project. (You can delete the default Class file, if desired).
  3. Configure the Properties for the project.
  • When assigning an assembly name for this object, use this format: [Descriptive Name]Wizard (remove spaces in the name)For example: SampleCheckInWizard (as shown in Figure 13.10).
  • Specify a root namespace for your project.For example: Aptify.SampleApplication.MotorLoaner, as shown in Figure 13.10. Wizard Project Properties
  1. Click the References tab in the Properties page and add a reference to the following Aptify objects:
  • AptifyApplication
  • AptifyAttributeManagement
  • AptifyExceptionManagement
  • AptifyGenericDataServices
  • AptifyGenericEntityBase
  • AptifyObjectRepository
  • AptifyUtility
  • AptifyWindowsControls
  • AptifyWizardControl
  • AptifyWizardSteps
  • IAptifyDataServicesInfo: References to the following Microsoft Objects should already exist in the project: System, System.Data, System.Drawing, System.Windows.Forms, and System.Xml. You can find the Aptify objects in your Aptify Windows application's C:\Program Files\Aptify 5.5 directory.
  1. Open the Form in Design mode (for example, right-click the form in the Solution Explorer and select View Designer from the pop-up menu). Open Form in Design Mode
  2. Review the available controls in the toolbox and add any other controls you might need in the wizard.
  • To add new controls to the toolbox, select the Tools > Choose Toolbox Items... option from the Visual Studio menu and then browse to the appropriate .NET control files. Aptify controls can be found in the C:\Program Files\Aptify 5.5 directory.
  • When designing a wizard for Aptify, you should select the -AptifyWizardControl assembly to add the Aptify Wizard Control to the toolbox. Add Toolbox Items
  • If you plan to use the Step control to generate and display the steps in your wizard, add the AptifyWizardSteps assembly.
  • If you plan to use any of the Aptify Windows Controls, such as a Link Box, then add the AptifyWindowsControls assembly. Note that using Aptify Windows Controls may also require a third-party control. See "Determine If You Need Third-Party Controls" on page 259 for details.
  1. Select the Wizard Control from the toolbox and dock it to the bottom of the form.Add Wizard Control


  1. Configure the properties for the Wizard Control as necessary in the Properties pane.
  2. Add a Panel Control for each page of the wizard.
  3. Add all of the appropriate controls for each page of the wizard.
  • Figure 13.14 illustrates the appearance of the Check-In wizard in Visual Studio Design mode. Wizard in Design Mode
  1. When finished designing the UI for the wizard, right-click the form class in the Solution Explorer and select View Code from the pop-up menu to open the code.
  2. Add Option Explicit On and Option Strict On at the top of the class file (as described in "Use Option Explicit and Option Strict" on page 71).
  3. Import the following namespaces:
  • Aptify.Framework.ExceptionManagement
  • Aptify.Framework.Application
  1. Define the name for your class (typically this is Public Class [Wizard Name]Wizard).
  2. Add Implements IAptifyAction below the class name. Implement IAptifyAction
  3. Define the DoAction method and other code to manage the Wizard control and other control interactions. Also, add any necessary helper functions.
  • The DoAction method is responsible for executing whatever code is placed in the function. In most cases, a developer will construct a set of private functions within the same class to accomplish the objectives of the wizard.
  • Review the source code for the Check-In and Check-Out wizards for examples.
  1. If creating a separate class for the wizard's logic, add code to call the wizard object for step validation, data retrieval and final step operations. Then, write the wizard object to perform the desired operations.
  • See "Separate UI from Logic for Wizards" on page 261 for a discussion of this option.
  1. Build, test, and sign the assembly. See "Recommendations for Writing Code" on page 68 for details.
  • See "Adding a Wizard to Aptify" on page 273 for instructions on how to add the wizard as an Entity Action.Info: The SampleCheckOutWizard project is configured to use Delayed Signing for illustration purposes. If you recompile the Check Out wizard's assembly for testing purposes, you need to sign the assembly with the sample application's private key or turn off verification for that assembly. See "Strong Name Verification in the Sample Application" on page 85 for details.
  • No labels