IUiCommandExecutionContext.Data

Syntax

Data: Variant;

Description

The Data property determines the data required to execute a command.

Object instances, file links, parameter arrays and others can be passed as a property value. The list of parameters for various commands is given in examples for the Execute method.

Example

Executing the example requires a form, with the Button1 button, the WorkspaceBox component named WorkspaceBox1 and the UiWorkspaceObject component, which is used as a data source for WorkspaceBox1.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);

Var

Target: IUiCommandTarget;

Context: IUiCommandExecutionContext;

Begin

Target := WinApplication.Instance.GetPluginTarget("Wsp");

Context := Target.CreateExecutionContext;

Context.Data := WorkspaceBox1.View;

Target.Execute("ShowStyleDialog", Context);

End Sub Button1OnClick;

Selecting a workspace object and clicking the button opens the dialog box to set up format of the selected object.

See also:

IUiCommandExecutionContext