OnAfterSearch(Sender: Object; Args: IMetabaseListViewAfterSearchEventArgs);
OnAfterSearch(Sender: Object; pArgs: Prognoz.Platform.Interop.ExtCtrls.MetabaseListViewAfterSearchEventArgs);
Sender. Parameter returning the component that has generated the event.
Args. The parameter allowing to determine event parameters.
The OnAfterSearch event occurs for the component, if all objects that satisfy given conditions were searched in the search dialog box.
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.
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.
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: