IModelBox.Apply

Fore Syntax

Apply: Boolean;

Fore.NET Syntax

Apply(): boolean;

Description

The Apply method applies parameters defined in ModelBox to the model used as a data source.

Comments

Apply returns the execution result. Available values:

To save the changes in data source, use the IModelBox.SaveObject method.

Fore Example

Executing the example requires a form, a button with the Button1 identifier on the form, the ModelBox component with the ModelBox1 identifier and the UiModel component that is a data source for ModelBox1. A model must be loaded to UiModel.

Add a link to the Ui system assembly. This code is 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 used.");
    End If;
End Sub Button1OnClick;

After executing the example, parameters set in the ModelBox component are applied to the open model. Results of operation are displayed in information message.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example. Use Fore.NET analogs instead of Fore components.

Private Sub Button1_Click(sender: System.Object; e: System.EventArgs);
Begin
    If modelBoxNet1.CtrlBox.Apply() Then
        MessageBox.Show("Parameters are used.");
    Else
        MessageBox.Show("Error. Parameters are not used.");
    End If;
End Sub;

See also:

IModelBox