ShowFindObjects Command

Purpose

It searches for repository objects according to the specified parameters and displays found objects in the object navigator.

Parameters of Use

Command parameters are passed in the Data property. Executing the command requires to specify an array of the Variant type in this property, the elements of this array contain the following values:

Value type Description
Element 1: IMetabase The repository, where search is executed.
Element 2: IMetabaseObjectFindInfo Parameters of repository objects search.
Element 3: IMetabaseObjectDescriptor The optional parameter containing description of the repository folder, which gets focus in the object navigator after the search is executed. If the element is not set, the focus is not moved in to the object navigator.

Application Features

None.

Fore Example

Executing the example requires a form with the Button1 button.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    MB: IMetabase;
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
    FindInfo: IMetabaseObjectFindInfo;
    Data: Array;
Begin
    MB := MetabaseClass.Active;
    Target := WinApplication.Instance.GetPluginTarget("Std");
    Context := Target.CreateExecutionContext;
    FindInfo := MB.CreateFindInfo;
    FindInfo.Text := "report";
    FindInfo.AttributeEx := FindAttributeEx.Name Or FindAttributeEx.Ident;
    FindInfo.WholeWordsOnly := False;
    FindInfo.ScanNestedNamespaces := True;
    Data := New Variant[2];
    Data[0] := MB;
    Data[1] := FindInfo;
    Context.Data := Data;
    Target.Execute("ShowFindObjects", Context);
End Sub Button1OnClick;

Clicking the button searches for all objects, which names or identifier contain the word "report". The list of found object is available in the Search Results window in the object navigator. It does not move to the object navigator after the search is executed.

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.

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

Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Var
    MB: IMetabase;
    WinApp: WinApplication = New WinApplicationClass_2();
    Target: IUiCommandTarget;
    Context: IUiCommandExecutionContext;
    FindInfo: IMetabaseObjectFindInfo;
    Data: Array;
Begin
    MB := Self.Metabase;
    Target := WinApp.GetPluginTarget("Std");
    Context := Target.CreateExecutionContext();
    FindInfo := MB.CreateFindInfo();
    FindInfo.Text := "report";
    FindInfo.AttributeEx := FindAttributeEx.fnaeName Or FindAttributeEx.fnaeIdent;
    FindInfo.WholeWordsOnly := False;
    FindInfo.ScanNestedNamespaces := True;
    Data := New Object[2];
    Data[0] := MB;
    Data[1] := FindInfo;
    Context.Data := Data;
    Target.Execute("ShowFindObjects", Context, Null);
End Sub;

See also:

IUiCommandTarget.Execute