MetabaseListView.OnAfterSearch

Fore Syntax

OnAfterSearch(Sender: Object; Args: IMetabaseListViewAfterSearchEventArgs);

Fore.NET Syntax

OnAfterSearch(Sender: Object; pArgs: Prognoz.Platform.Interop.ExtCtrls.MetabaseListViewAfterSearchEventArgs);

Parameters

Sender. Parameter returning the component that has generated the event.

Args. The parameter allowing to determine event parameters.

Description

The OnAfterSearch event occurs for the component, if all objects that satisfy given conditions were searched in the search dialog box.

Comments

The search in the component dialog box is called on clicking the CTRL+F shortcut keys or on executing the IMetabaseListView.ShowFindDialog method. The Find All button is available in the search dialog box, when the IMetabaseListView.EnableFindAll property is set to True. If the Find All button is clicked in the dialog box, the search for the component results in the OnAfterSearch event generation. Using the IMetabaseListViewAfterSearchEventArgs.FoundObjects property of the event argument, it is possible to get descriptions of found objects.

Fore Example

Executing the example requires a form, a button with the Button1 identifier on this form and the Memo component with the Memo1 identifier. Any repository folder is selected in the Root property of the MetabaseListView component.

Add links to the ExtCtrls, Metabase system assemblies.

// The OnAfterSearch event handler for the MetabaseListView1 component
Sub MetabaseListView1OnAfterSearch(Sender: Object; Args: IMetabaseListViewAfterSearchEventArgs);
Begin
    Debug.WriteLine(
"Number of found objects:");
    Debug.WriteLine(Args.FoundObjects.Count);
End Sub MetabaseListView1OnAfterSearch;
// The OnClick event handler for the Button1 component
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Begin
    MetabaseListView1.EnableFindAll := 
True;
    MetabaseListView1.ShowFindDialog;
End Sub Button1OnClick;

After executing the example the console window displays the information about the number of found objects.

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.ExtCtrls;

// The OnAfterSearch event handler for the MetabaseListView1 component
Private
 Sub metabaseListViewNet1_OnAfterSearch(pSender: System.Object; pArgs: Prognoz.Platform.Interop.ExtCtrls.MetabaseListViewAfterSearchEventArgs);
Begin
    System.Diagnostics.Debug.WriteLine(
"Number of found objects:");
    System.Diagnostics.Debug.WriteLine(pArgs.FoundObjects.Count);
End Sub;
// The OnClick event handler for the Button1 component
Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
Begin
    MetabaseListViewNet1.EnableFindAll := 
True;
    MetabaseListViewNet1.CtrlBox.ShowFindDialog();
End Sub;

See also:

MetabaseListView