How To : Providing a Main Class And Run Functions

Back to Concepts and HOW TOs

Contents

[edit] Description

You can either add a Main class (with associated run functions) to your main AppProject, or assign an existing class and functions to these roles.

[edit] Prerequisites

Understanding the Main Class and Run Functions
Understanding Solutions and Projects
Adding a Class to a Project

[edit] Procedure

To add a main class and associated run functions to your AppProject

  1. If you have not done so, add an AppProject you want to act as the entry point to your application.
  2. Select the AppProject.
  3. On the Solution Explorer toolbar, click the orange Add Main Class button. The Main class appears under your AppProject, and the run and afterRenderInitialization functions appear in the Solution Details.

To specify an existing class and functions as main and run functions for your AppProject

Note The "run" functions must be members of the class you assign to be your application's "main" class. 

  1. If you have not done so, add an AppProject you want to act as the entry point to your application.
  2. Select the AppProject, then on the General tab of the Property Editor, on the Main Class for Application property click the ellipsis button [...] and choose the class you want to assign as the "main" class of your application.
  3. Select the function you want to act as your application's "Run" function.
  4. On the General tab of the Property Editor, on the Adapter List property click the ellipsis button to assign the FunctionAdapter:MainRunFunction function adapter to that function.
    If you want to optimize your application start time, select the function you want to act as your application's "afterRenderInitialization" function.

    Caveat The MainPostRenderInit adapter and associated functionality will be available in the code release scheduled for the end of February 2008.

  5. On the General tab of the Property Editor, on the Adapter List property click the ellipsis button to assign the FunctionAdapter:MainPostRenderInit function adapter to that function.

[edit] Error Handling

 

[edit] Examples

When you select the Main class that you add in the first procedure above, you can see the functions that get added with the class. This is where you add your start up functionality. If you select one of these functions and look at the Adapter List property, you can see the function adapters used to identify these functions.

 

[edit] Next Steps

Adding a Page to an AppProject
Understanding Application Posting and Deployment

[edit] Tags


Log in if you would like to rate this page.
    Copyright © 2005 - 2007 Bungee Labs. All rights reserved.