It opens a standard dialog box for creating an repository object shortcut.
Command parameters are passed in the Data property. To ensure command execution, specify one of the following values in this property:
Value type |
Description |
IMetabaseObjectDescriptor | The folder, in which a shortcut is created. |
Array | An array of the Variant type containing the following elements:
|
None
Executing the example requires a form with the Button1 button and a repository object with the Obj_1 identifier.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
v: variant;
mb: IMetabase;
Folder: IMetabaseObjectDescriptor;
Root: IMetabaseObjectDescriptor;
Target: IUiCommandTarget;
Context: IUiCommandExecutionContext;
Data: Array Of Variant;
Begin
MB := MetabaseClass.Active;
Folder := MB.ItemById("Obj_1");
Root := MB.ItemById("Obj_1");
Target := WinApplication.Instance.GetPluginTarget("Fld");
Context := Target.CreateExecutionContext;
Data := New Variant[2];
Data[0] := Folder;
Data[1] := Root;
Context.Data := Data;
v := Target.Execute("ShowCreateShortcut", Context);
If Not v.IsNull Then
text := (v As IMetabaseObjectDescriptor).Name;
End If;
End Sub Button1OnClick;
Clicking the button opens a dialog box for creating a shortcut of the Obj_1 repository object.
See also: