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 the User Objects subgroup of commands is selected.
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:
Writing of data to custom class object
Reading of data from custom class object
In order working with custom class objects in the object navigator matches working with other repository objects, create the list of operations in class settings and specify the handler that contains class with realization of operations. For example, the class realization, used to handle standard operations Open, Edit and two more operations, is the following:
To write or read data in custom class objects, the above mentioned operations can be written to events handlers:
If required, custom class objects can converted into parametric ones. To do so, fill the IMetabaseObjectDescriptor.Params window. The following code can be used to create parameters:
Before performing the operation the parameters input window collection. 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, the handler is called, but it gets empty parameter values.
The corresponding handlers should be implemented to handle operations of parametric objects:
See also: