Modifying a .NET Assembly project

You can modify a .NET Assembly project from the Project painter. In addition to the values for fields that you entered in the target and project wizards, you can also modify version, debug, and run settings from the Project painter. The Objects tab of the Project painter lets you select and rename functions of the nonvisual objects you deploy to a .NET assembly.

Each .NET Assembly project has seven tab pages: General, Objects, Resource Files, Library Files, Version, Post-build, and Run.

General tab

The General tab in the Project painter allows you to modify the namespace, assembly file name, and setup file name for a .NET Assembly project. It also has a check box you can select to use .NET nullable datatypes. These fields are described in Table 12-1 or Table 12-2.

In addition, the General tab has fields that are not available in the target or project wizards. Table 12-3 describes these additional fields.

Table 12-3: Additional fields available on the General tab

Project field

Description

Debug or Release

Radio button options that determine whether the project is deployed as a debug build (default selection) or a release build. You use debug builds for debugging purposes. Release builds have better performance, but when you debug a release build, the debugger does not stop at breakpoints.

Enable DEBUG symbol

Select to activate code inside conditional compilation blocks using the DEBUG symbol. This selection does not affect and is not affected by the project’s debug build or release build setting. This check box is selected by default.

Objects tab

The Objects tab in the Project painter lists all the nonvisual user objects available for deployment from the current .NET Assembly target. The Custom Class field lists all these objects even if you did not select them in the target or project wizard.

Objects that you selected in the wizard display with a user object icon in the Custom Class treeview. All methods for the objects selected in the wizard are also selected for deployment by default, but you can use the Objects tab to prevent deployment of some of these methods and to change the method names in the deployed component.

Table 12-4 describes all the fields available on the Objects tab.

Table 12-4: Fields available on the Objects tab

Project field

Description

Custom class

Select an object in this treeview list to edit its list of functions for inclusion in or exclusion from the assembly component. You can edit the list for all the objects you want to include in the assembly, but you must do this one object at a time.

Object name, Class name, and Namespace

You can change the object name only by selecting a different object in the Custom Class treeview. By default, the class name is the same as the object name, but it is editable. In the Project painter, the namespace is editable only on the General tab.

Method names and Function prototypes

Select the check box for each function of the selected custom class object you want to deploy to a .NET assembly. Clear the check box for each function you do not want to deploy. You can modify the method names in the Method Names column. The Function Prototype column is for descriptive purposes only.

Change method name and description

You enable these buttons by selecting a method in the list of method names. PowerBuilder allows overloaded functions, but each function you deploy in an assembly class must have a unique name. After you click the Change Method Name button, you can edit the selected method name in the Method Name column. The Change Method Description button lets you add or edit a method description.

Select All and Unselect All

Click the Select All button to select all the functions of the current custom class object for deployment. Click the Unselect All button to clear the check boxes of all functions of the current custom class object. Functions with unselected check boxes are not deployed to a .NET assembly.

Resource Files and Library Files tabs

The fields that you can edit on the Resource Files and Library Files tabs of the Project painter are the same as the fields available in the target and project wizards. These fields are described in Table 12-1.

The Resource Files page of the Project painter does have an additional field that is not included in the project or target wizard. The additional field is a Recursive check box next to each directory that you add to the Resource Files list. By default, this check box is selected for each directory when you add it to the list, but you can clear the check box to avoid deployment of unnecessary subdirectory files.

Version, Post-build, and Run tabs

The fields on the Version, Post-build, and Run tabs of the Project painter are not available in the .NET Assembly target or project wizards. Table 12-5 describes these fields.

Table 12-5: Fields available on the Version, Post-build, and Run tabs

Project field

Description

Product name, Company, Description, and Copyright (Version tab)

You can specify identification, description, and copyright information that you want to associate with the assembly you generate for the project.

Product version, File version, and Assembly (Version tab)

You can enter major, minor, build, and revision version numbers for the product, file, and assembly.

Post-build command line list (Post-build tab)

You can use the Add button to include command lines that run immediately after you deploy the project. For example, you can include a command line to process the generated component in a code obfuscator program, keeping the component safe from reverse engineering.

The command lines run in the order listed, from top to bottom. You can save separate sequences of command lines for debug and release build types.

Application (Run tab)

You use this text box to enter the name of an application with code that invokes the classes and methods of the generated assembly. If you do not enter an application name, you get an error message when you try to run or debug the deployed project from the PowerBuilder IDE.

Argument (Run tab)

You use this text box to enter any parameters for an application that invokes the classes and methods of the deployed project.

Start In (Run tab)

You use this text box to enter the starting directory for an application that invokes the classes and methods of the deployed project.