Creating User Class Objects

Custom class objects are created in the object navigator as other repository objects. To do this, in the navigator's context menu of the New Object button in the Create group on the Home ribbon tab select the User Objects subgroup of commands.

The further work with custom class objects is fully done via the Fore language. Properties and methods of accessing a custom class object are contained in the IMetabaseCustomObject interface of the Metabase assembly. A custom class object can contain any data. Consider simple examples for writing data to a custom class object and reading data from it. Data will be read or written from or to file:

Write data to custom class object

Read data from custom class object

Executing Operations

In order the working with custom class objects in the object navigator matches working with other repository objects, create a list of operations in class settings and specify the handler that contains class with implementation of operations. For example, the class implementation that is used to handle standard operations Open, Edit and two more operations is the following:

Class with operations

To write or read data in custom class objects, the above mentioned operations can be written to events handlers:

Read or write data

Parametric Custom Class Objects

If required, custom class objects can be converted into parametric ones. To do so, via Fore fill in the IMetabaseObjectDescriptor.Params collection. The following code can be used to create parameters:

Create parameters

Before executing the operation the parameters input dialog box opens for parametric object. After the values are entered and the OK button is clicked, the corresponding handler method is called. If the Cancel button is clicked in the dialog box, the handler is called but it passes empty parameter values.

The corresponding handlers must be implemented to handle operations of parametric objects:

Class with operations

See also: