IProject interface
Library: TFORMer9Lib
Provides access to project information in a Repository or a stand-alone FormLayout.
Usage and notes
This class is used to retrieve or set information belonging to a user-defined Project or to the GlobalProject.
Overview
A Project is a logical container for related FormLayout, DataSource and DataField definitions. It divides a Repository into logical units.
Exactly one GlobalProject is available for both a Repository or a stand-alone FormLayout. In the case of a Repository additional Project objects can be created by the user.
For each Project TFORMer Designer creates a subfolder below the main Repository file. FormLayouts, which are member of this Project are stored in this subfolder.
A stand-alone FormLayout can only use the GlobalProject (it references the FormLayout itself). The GlobalProject of a Repository can't be used to reference FormLayouts.
DataFields and DataSources defined in a Project are usable exclusively by FormLayouts which are member exactly of this Project.
DataFields and DataSources defined in the GlobalProject are usable by all FormLayouts in all Projects.
Working with Data Fields
Find a data field: Use Project.GetDataField.
Iterate through data fields: Start with Project.FirstDataField and continue with DataField.Next.
Check field usage: Use FormLayout.GetDataFieldUsage to check whether a field is used in a particular form layout.
Example
To retrieve all Project objects within a Repository do the following:
' Retrieve the first Project '
Set project = repository.FirstProject
While Not (project Is Nothing)
MsgBox project.Name, vbOKOnly, "Project"
' Get the next Project '
Set project = project.Next
Wend
Attention
The Project is only valid as long as it is available in the Repository. If it is removed from the Repository all instances of the Project immediately become invalid.
More Information
Note
Thread-safety: A single instance of this class must not be used by different threads.
Inheritance and related types
Base types: IDispatch
Properties
| Member | Description |
|---|---|
| Comment | Gets/Sets the comment for the Project. |
| DefaultDirectory | Gets the default directory of the Project. |
| Description | Gets/Sets the description of the Project. |
| FirstDataField | Gets the first DataField of the Project. |
| FirstDataSource | Gets the first DataSource defined in the Project. |
| FirstFormLayout | Gets the first FormLayout of the Project. |
| Name | Gets/Sets the name of the Project. |
| Next | Gets the next Project defined in the Repository. |
| NumberOfDataFields | Gets the number of DataFields defined in the Project. |
| NumberOfDataSources | Gets the number of DataSources defined in the Project. |
| NumberOfFormLayouts | Gets the number of FormLayouts defined in this Project. |
Methods
| Member | Description |
|---|---|
| AddDataField(String) | Creates and adds a DataField to the Project. |
| AddDataSource(DataSourceType, String) | Creates and adds a DataSource to the Project. |
| AddFormLayout(String) | Creates and adds a FormLayout to the Project. |
| GetDataField(String) | Gets the DataField information from the Project. |
| GetDataSource(String) | Gets the DataSource information from the Project. |
| GetFormLayout(String) | Gets the FormLayout information from the Project. |
| RemoveDataField(IDataField) | Removes a DataField from the Project. |
| RemoveDataSource(IDataSource) | Removes the DataSource from the Project. |
| RemoveFormLayout(IFormLayout) | Removes a FormLayout from the Project. |