IWinApplication.GetObjectTarget

Syntax

GetObjectTarget(Object: IMetabaseObjectDescriptor): IUiCommandTarget;

Parameters

Object. Description of a repository object, with which an operation is to be executed.

Description

The GetObjectTarget method creates an object that executes some operations with repository objects using reserved commands.

Comments

The list of commands available for objects is given in description of the IUiCommandTarget.Execute method.

Fore Example

Executing the example requires that the repository contains a table with the Table_1 identifier.

Sub UserProc;
Var
    Mb: IMetabase;
    ObjDes: IMetabaseObjectDescriptor;
    Target: IUiCommandTarget;
Begin
    MB := MetabaseClass.Active;
    ObjDes := MB.ItemById("Table_1");
    Target := WinApplication.Instance.GetObjectTarget(ObjDes);
    Target.Execute("Object.Open"Null);
End Sub UserProc;

On executing the example the selected repository table is opened.

Fore.NET Example

Executing the example requires that the repository contains a table with the Table_1 identifier. The procedure is an entry point of the .NET assembly.

Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Ui;

Public Shared Sub Main(Params: StartParams);
Var
    Mb: IMetabase;
    WinApp: WinApplication = New WinApplicationClass_2();
    ObjDes: IMetabaseObjectDescriptor;
    Target: IUiCommandTarget;
Begin
    MB := Params.Metabase;
    ObjDes := MB.ItemById["Table_1"];
    Target := WinApp.GetObjectTarget(ObjDes);
    Target.Execute("Object.Open"NullNull);
End Sub;

On executing the example the selected repository table is opened.

See also:

IWinApplication | IUiCommandTarget