Class InputBindings<TEvent, TBinding>
Abstract class for KeyBindings and MouseBindings.
public abstract class InputBindings<TEvent, TBinding> where TEvent : notnull where TBinding : IInputBinding, new()
Type Parameters
TEvent
The type of the event (e.g. Key or MouseFlags).
TBinding
The binding type (e.g. KeyBinding).
- Inheritance
-
InputBindings<TEvent, TBinding>
- Derived
- Inherited Members
Constructors
- InputBindings(Func<Command[], TEvent, TBinding>, IEqualityComparer<TEvent>)
Initializes a new instance.
Methods
- Add(TEvent, params Command[])
Adds a new
TEvent
that will trigger the commands incommands
.If the
TEvent
is already bound to a different set of Commands it will be reboundcommands
.
- Add(TEvent, TBinding)
Adds a
TEvent
bound toTBinding
to the collection.
- Clear()
Removes all
TEvent
objects from the collection.
- Clear(params Command[])
Removes all bindings that trigger the given command set. Views can have multiple different
TEvent
bound to the same command sets and this method will clear all of them.
- Get(TEvent)
Gets the
TBinding
for the specifiedTEvent
.
- GetAllFromCommands(params Command[])
Gets all
TEvent
bound to the set of commands specified bycommands
.
- GetBindings()
Gets the bindings.
- GetCommands(TEvent)
Gets the array of Commands bound to
eventArgs
if it exists.
- GetFirstFromCommands(params Command[])
Gets the first matching
TEvent
bound to the set of commands specified bycommands
.
- IsValid(TEvent)
Tests whether
eventArgs
is valid or not.
- Remove(TEvent)
Removes a
TEvent
from the collection.
- Replace(TEvent, TEvent)
Replaces a
TEvent
combination already bound to a set of Commands.
- ReplaceCommands(TEvent, params Command[])
Replaces the commands already bound to a combination of
TEvent
.
- TryGet(TEvent, out TBinding?)
Gets the commands bound with the specified
TEvent
.