Library/PackageCache/com.unity.quicksearch@1.6.0-preview.8/Editor/QuickSearch.cs
/// <summary>
/// Execute a Search Action on a given list of items.
/// </summary>
/// <param name="action">Action to execute.</param>
/// <param name="items">Items to apply the action on.</param>
/// <param name="endSearch">If true, executing this action will close the Quicksearch window.</param>
Execute a Search Action on a given list of items.
Execute a Search Action on a given list of items .
public void ExecuteAction(SearchAction action, SearchItem[] items, bool endSearch = true)
        {
            var item = items.LastOrDefault();
            if (item == null)
                return;
            SendSearchEvent(item, action);
            EditorApplication.delayCall -= DelayTrackSelection;
            if (selectCallback != null)
            {
                selectCallback(item, false);
                selectCallback = null;
            }
            else
            {
                if (endSearch)
                    SearchField.UpdateLastSearchText(context.searchText);
                if (action.execute != null)
                    action.execute(items);
                else action.handler?.Invoke(item);
            }
            if (endSearch && action.closeWindowAfterExecution)
                CloseSearchWindow();
        }
public void ExecuteAction ( SearchAction action , SearchItem [ ] items , bool endSearch = true ) { var item = items . LastOrDefault ( ) ; if ( item == null ) return ; SendSearchEvent ( item , action ) ; EditorApplication . delayCall -= DelayTrackSelection ; if ( selectCallback != null ) { selectCallback ( item , false ) ; selectCallback = null ; } else { if ( endSearch ) SearchField . UpdateLastSearchText ( context . searchText ) ; if ( action . execute != null ) action . execute ( items ) ; else action . handler ? . Invoke ( item ) ; } if ( endSearch && action . closeWindowAfterExecution ) CloseSearchWindow ( ) ; }
Execute a Search Action on a given list of items.
Execute a Search Action on a given list of items .
action
SearchAction
Action to execute.
Action to execute .
items
SearchItem[]
Items to apply the action on.
Items to apply the action on .
endSearch
bool
If true, executing this action will close the Quicksearch window.
If true executing this action will close the Quicksearch window .