How To : Providing a Main Class And Run Functions
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
- If you have not done so, add an AppProject you want to act as the entry point to your application.
- Select the AppProject.
- 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.
- If you have not done so, add an AppProject you want to act as the entry point to your application.
- 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.
- Select the function you want to act as your application's "Run" function.
- 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.
- 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