Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The following steps provide an overview of how to write a new code-based wizard for Aptify: Info:

Info

If using the template provided by Aptify for this project, configure the template as described in

...

Loading the Sample Code and Templates

...

, 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

...

    • below).
    • Specify a root namespace for your project. For example: Aptify.SampleApplication.MotorLoaner, as shown

...

    • below.

       Wizard Project PropertiesImage Added
  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
    • IAptifyDataServices

      Info

...

    • 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'

...

    • 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 Image Removed

     Open Form in Design ModeImage Added
  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 ItemsImage Added
    • 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,

...

    • add the AptifyWindowsControls assembly. Note that using Aptify Windows Controls may also require a third-party control. See

...

...

...

    •  for details.
       
  1. Select the Wizard Control from the toolbox and dock it to the bottom of the form.Add Wizard Control Image Removed

    Add Wizard ControlImage Added
  2. Configure the properties for the Wizard Control as necessary in the Properties pane.
  3. Add a Panel Control for each page of the wizard.
  4. Add all of the appropriate controls for each page of the wizard.

    ...

      • The following figure illustrates the appearance of the Check-In wizard in Visual Studio Design mode. 

    ...


      •  Wizard in Design ModeImage Added
    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
         
    4. Define the name for your class (typically this is Public Class [Wizard Name]Wizard).
    5. Add Implements IAptifyAction below the class name. Implement IAptifyAction Image Removed

       Implement IAptifyActionImage Added
    6. 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.
         
    7. 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

    ...

    ...

      •  for a discussion of this option.
         
    1. Build, test, and sign the assembly. See "Recommendations for Best Practices When Writing Code " on page 68 for Aptify for details.
      • See

    ...

    ...

      •  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

    ...

    ...

      • for details.