Generating the C# Classes

The Generate sheet of the C# Exposure Wizard enables you to generate C# classes from the C# exposure.

An example of the Generate sheet is shown in the following image.

Generating the C# exposure indicates that the mapping process is complete. As this is the last step in the wizard, the Next button is replaced with a Close button.

The Generate sheet enables you to specify the location of generated C# files and whether to generate sample project files and sample application configuration files containing specified values.

To generate your C# class library

  1. In the Output directory for C# classes text box, enter the absolute path of the directory to which the C# classes will be written. Alternatively, click the Browse button and then select the appropriate directory in the common Browse For Directory dialog. You must enter or select a valid output directory.

    In thin client mode, generated C# files are located on the presentation client.

  2. Uncheck the Generate sample .csproj file check box if you do not want to generate a sample .csproj file. You can use this project file as a starting point for creating a Microsoft Visual Studio solution.

    This check box is checked by default for a new C# exposure and it is unchecked if you are modifying an existing C# exposure. When you generate a sample file for an existing C# exposure and a file with the default name already exists, the common File Save dialog is then displayed, prompting you to specify an alternative file name.

  3. Uncheck the Generate sample .config file check box if you do not want to generate a sample .config file. Configuration values are specified in the following steps of this instruction.

    This check box is checked by default for a new C# exposure and it is unchecked if you are modifying an existing C# exposure. When you generate a sample file for an existing C# exposure and a file with the default name already exists, the common File Save dialog is then displayed, prompting you to specify an alternative file name.

    When the Generate sample .config file check box is checked:

    1. Specify the absolute path of the JADE database directory in the Jade database path text box or click the Browse button and then select the appropriate directory in the common Browse For Directory dialog.

    2. Specify the name and the absolute path of the JADE initialization file in the Jade initialization file path text box or click the Browse button and then select the appropriate directory and file in the common Browse For Directory dialog.

    3. Specify the value that you require for the schema to which the C# system signs on in the Sign-on schema name text box.

    4. In the Sign-on application name list box, select the non-GUI application in the schema specified in step 3.c of this instruction that you want to specify as the default application.

      Only applications of type Non-GUI are displayed in this list box.

    5. Uncheck the Sign-on to Jade as Multiuser check box if you want to sign on to the JADE database in single user mode only.

  4. Click the Generate button to initiate the generating of a C# class for each exposed JADE class and optionally the .config and .csproj files.

  5. When the generate process is complete (indicated at the lower-left of the wizard), click the Close button.

The C# sheet of the Exposure Browser is then displayed with your new or updated C# exposure and the C# classes generated. Any existing files with the same name are automatically overwritten. You can use the generated C# classes and the .csproj file with Visual Studio to create a .NET class library.

When the C# exposure is generated from JADE, the C# source includes any text defined for an exposed class, property, and method, so that it can be carried over to .NET in the exposure for inline help. The generated format is:

/// <summary> 
/// <text-line-1> 
/// <text-line-2> 
/// <...> 
/// </summary>

For details about generating C# code (get and set methods for every property in every class, but not methods and constants), see "Running a Non-GUI Client Application using jadclient", in Chapter 1 of the JADE Runtime Application Guide.

We recommend that you do not edit the C# classes, as your changes would be lost if the class was regenerated. In addition, we recommend that each exposure is used to build its own DLL so that the .NET application can link to the generated class library.