Class AchievementsStudioFilter
Narrows the Studio's row list to what the toolbar asks for: the text typed into the search field, and the category picked beside it.
Inherited Members
Namespace: Serenity.Achievements.Infrastructure.Editor.Studio
Assembly: Serenity.UnityAchievements.Infrastructure.Editor.dll
Syntax
public static class AchievementsStudioFilter
Remarks
Pure and separate from the window because "did the search box hide the row the author was looking at"
is a question worth asserting, and an EditorWindow cannot be asked it. Search and category are
applied together rather than in two passes so a row is judged once, and so the answer to "how many
match" is the length of one list.
Fields
FilterLabels
The labels the filter popup shows, in AchievementsStudioFilterKind order.
Declaration
public static readonly string[] FilterLabels
Field Value
| Type | Description |
|---|---|
| string[] |
Methods
Apply(IReadOnlyList<AchievementsStudioRowModel>, string, AchievementsStudioFilterKind)
Narrows a list of rows to the ones the toolbar asks for.
Declaration
public static IReadOnlyList<AchievementsStudioRowModel> Apply(IReadOnlyList<AchievementsStudioRowModel> rows, string search, AchievementsStudioFilterKind filter)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<AchievementsStudioRowModel> | rows | Every row. May be null and may contain null. |
| string | search | What was typed into the search field. |
| AchievementsStudioFilterKind | filter | The category picked in the toolbar. |
Returns
| Type | Description |
|---|---|
| IReadOnlyList<AchievementsStudioRowModel> | The surviving rows, in the order given. |
Matches(AchievementsStudioRowModel, string, AchievementsStudioFilterKind)
Whether one row survives the search text and the category.
Declaration
public static bool Matches(AchievementsStudioRowModel row, string search, AchievementsStudioFilterKind filter)
Parameters
| Type | Name | Description |
|---|---|---|
| AchievementsStudioRowModel | row | The row to judge. Null never matches. |
| string | search | What was typed into the search field. Blank matches everything. |
| AchievementsStudioFilterKind | filter | The category picked in the toolbar. |
Returns
| Type | Description |
|---|---|
| bool | True when the row should stay in the list. |