OpenNavigator Command

Purpose

Opens a repository in the object navigator.

Parameters of Use

Command parameters are passed in the Data property. Executing the command requires to specify the following value in this property:

Parameter Description
IMetabase Repository to be opened in the object navigator.

Application Features

It is used to open an already connected repository in the object navigator.

Example

Executing the example requires a form and a button named Button1 on the form. Platform connection settings include description of the Test repository. The "Test" password and user name are used to connect to this repository.

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        MB: IMetabase;
        MAN: IMetabaseManager;
        Def: IMetabaseDefinition;
        Cred: ICredentials;
        Target: IUiCommandTarget;
        Context: IUiCommandExecutionContext;
    Begin
        MB := MetabaseClass.Active;
        MAN := MB.Definition.Manager;
        Cred := MAN.Packs.Item(0).Package.CreateCredentials(AuthenticationMode.Password);
        Def := MAN.Definitions.FindById("Test");
        (Cred As IPasswordCredentials).UserName := "Test";
        (Cred As IPasswordCredentials).Password := "Test";
        MB := Def.Open(Cred);
        Target := WinApplication.Instance.GetPluginTarget("Std");
        Context := Target.CreateExecutionContext;
        Context.Data := MB;
        Target.Execute("OpenNavigator", Context);
    End Sub Button1OnClick;

Clicking the button establishes connection to the Test repository. Repository window opens in the object navigator.

See also:

IUiCommandTarget.Execute