mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Use existing GetStateFromSelection
helper function
This commit is contained in:
@ -268,6 +268,17 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
DeleteSelected();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Given a selection target and a function of truth, retrieve the correct ternary state for display.
|
||||
/// </summary>
|
||||
protected static TernaryState GetStateFromSelection<TObject>(IEnumerable<TObject> selection, Func<TObject, bool> func)
|
||||
{
|
||||
if (selection.Any(func))
|
||||
return selection.All(func) ? TernaryState.True : TernaryState.Indeterminate;
|
||||
|
||||
return TernaryState.False;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called whenever the deletion of items has been requested.
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user