Apply: Boolean;
The Apply method applies parameters defined in ModelBox to the model used as a data source.
The Apply method returns the execution result. Available values:
True. Parameters are used successfully.
False. Error. Parameters were not used.
To save the changes in data source, use the IModelBox.SaveObject method.
Executing the example requires that the repository contains a form with the following:
A button with the Button1 identifier.
The ModelBox component with the ModelBox1 identifier.
The UiModel component with the UiModel1 identifier. The UiModel1 component is a data source for ModelBox1 and contains a loaded model.
Add links to the Ms and Ui system assemblies.
This code is a handler of the OnClick event for the Button1 button.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Begin
If ModelBox1.Apply Then
WinApplication.InformationBox("Parameters are used.");
Else
WinApplication.InformationBox("Error. Parameters are not applied.");
End If;
End Sub Button1OnClick;
After executing the example, the parameters set in the ModelBox component will be applied to the opened model. Results of operation are displayed in information message.
See also: