MetabaseListView.OnAfterSearch

Syntax

OnAfterSearch(Sender: Object; Args: IMetabaseListViewAfterSearchEventArgs);

Parameters

Sender. The parameter that returns the component that generated the event.

Args. The parameter that enables the user 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 dialog box in the component opens on pressing CTRL+F 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.FindedObjects property of the event argument, one can get descriptions of found objects.

Example

Executing the example requires a form with the button named Button1 and the MetabaseListView component named MetabaseListView1. 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.

See also:

MetabaseListView