Class SearchAction
Define an action that can be applied on SearchItem of a specific provider type.
Namespace: Unity.QuickSearch
Syntax
public class SearchAction
Constructors
SearchAction(String, GUIContent)
Default constructor to build a search action.
Declaration
public SearchAction(string providerId, GUIContent content)
Parameters
Type | Name | Description |
---|---|---|
String | providerId | Provider Id that supports this action. |
GUIContent | content | Display information when displaying the action in the Action Menu |
SearchAction(String, GUIContent, Action<SearchItem[]>)
Default constructor to build a search action.
Declaration
public SearchAction(string providerId, GUIContent content, Action<SearchItem[]> handler)
Parameters
Type | Name | Description |
---|---|---|
String | providerId | Provider Id that supports this action. |
GUIContent | content | Display information when displaying the action in the Action Menu |
Action<SearchItem[]> | handler | Handler that will execute the action. |
SearchAction(String, GUIContent, Action<SearchItem>)
Default constructor to build a search action.
Declaration
public SearchAction(string providerId, GUIContent content, Action<SearchItem> handler)
Parameters
Type | Name | Description |
---|---|---|
String | providerId | Provider Id that supports this action. |
GUIContent | content | Display information when displaying the action in the Action Menu |
Action<SearchItem> | handler | Handler that will execute the action. |
SearchAction(String, String, Texture2D, String)
Extended constructor to build a search action.
Declaration
public SearchAction(string providerId, string name, Texture2D icon = null, string tooltip = null)
Parameters
Type | Name | Description |
---|---|---|
String | providerId | Provider Id that supports this action. |
String | name | Label name when displaying the action in the Action Menu |
Texture2D | icon | Icon when displaying the action in the Action Menu |
String | tooltip | Tooltip assocoated with the when displayed in the Action Menu |
SearchAction(String, String, Texture2D, String, Action<SearchItem[]>)
Extended constructor to build a search action.
Declaration
public SearchAction(string providerId, string name, Texture2D icon, string tooltip, Action<SearchItem[]> handler)
Parameters
Type | Name | Description |
---|---|---|
String | providerId | Provider Id that supports this action. |
String | name | Label name when displaying the action in the Action Menu |
Texture2D | icon | Icon when displaying the action in the Action Menu |
String | tooltip | Tooltip assocoated with the when displayed in the Action Menu |
Action<SearchItem[]> | handler | Handler that will execute the action. |
SearchAction(String, String, Texture2D, String, Action<SearchItem>)
Extended constructor to build a search action.
Declaration
public SearchAction(string providerId, string name, Texture2D icon, string tooltip, Action<SearchItem> handler)
Parameters
Type | Name | Description |
---|---|---|
String | providerId | Provider Id that supports this action. |
String | name | Label name when displaying the action in the Action Menu |
Texture2D | icon | Icon when displaying the action in the Action Menu |
String | tooltip | Tooltip assocoated with the when displayed in the Action Menu |
Action<SearchItem> | handler | Handler that will execute the action. |
Fields
closeWindowAfterExecution
Indicates if the search view should be closed after the action execution.
Declaration
public bool closeWindowAfterExecution
Field Value
Type | Description |
---|---|
Boolean |
enabled
Callback used to check if the action is enabled based on the current context.
Declaration
public Func<IReadOnlyCollection<SearchItem>, bool> enabled
Field Value
Type | Description |
---|---|
Func<IReadOnlyCollection<SearchItem>, Boolean> |
execute
Execute a action on a set of items.
Declaration
public Action<SearchItem[]> execute
Field Value
Type | Description |
---|---|
Action<SearchItem[]> |
handler
This handler is used for action that do not support multi selection.
Declaration
public Action<SearchItem> handler
Field Value
Type | Description |
---|---|
Action<SearchItem> |
Properties
displayName
Name used to display
Declaration
public string displayName { get; }
Property Value
Type | Description |
---|---|
String |
id
Action unique identifier.
Declaration
public string id { get; }
Property Value
Type | Description |
---|---|
String |