Volume Control
Application-specific hotkeys for Windows
VolumeControl.Core.Input.HotkeyManager Class Reference

Manages a list of Hotkey instances. More...

Collaboration diagram for VolumeControl.Core.Input.HotkeyManager:

Public Member Functions

 HotkeyManager (HotkeyActionManager actionManager)
 Creates a new HotkeyManager instance from the specified actionManager . More...
 
 HotkeyManager ()
 Creates a new HotkeyManager instance with a new Actions.HotkeyActionManager instance. More...
 
HotkeyGetHotkey (ushort id)
 Gets the Hotkey with the specified id . More...
 
void AddHotkey (Hotkey hotkey)
 Adds the specified hotkey to the manager. More...
 
bool RemoveHotkey (Hotkey hotkey)
 Removes the specified hotkey from the manager. More...
 
bool RemoveHotkey (ushort id)
 Removes the hotkey with the specified id from the manager. More...
 
void ClearHotkeys ()
 Removes all hotkeys from the manager. More...
 
virtual JsonHotkey[] GetJsonHotkeys ()
 Gets a list of JsonHotkey instances for the list of managed hotkeys. More...
 
void AddJsonHotkeys< THotkey > (params JsonHotkey[] hotkeyJsonObjects)
 Creates and adds a Hotkey for each element of the specified hotkeyJsonObjects . More...
 
void SetHotkeysFromJsonHotkeys< THotkey > (JsonHotkey[] hotkeyJsonObjects)
 Sets the list of managed hotkeys from the specified hotkeyJsonObjects . More...
 
virtual void SetHotkeysFromJsonHotkeys (JsonHotkey[] hotkeyJsonObjects)
 

Properties

HotkeyActionManager HotkeyActionManager [get]
 Gets the action manager instance for this HotkeyManager. More...
 
IReadOnlyList< HotkeyHotkeys [get]
 Gets the hotkey instances that are being managed by this HotkeyManager. More...
 
IReadOnlyList< HotkeyMessageHookAbstractorHookAbstractors [get]
 Gets the list of HotkeyMessageHookAbstractor instances that are currently active. More...
 

Events

EventHandler< Hotkey >? AddedHotkey
 Occurs when a hotkey is added to the list for any reason. More...
 
EventHandler< Hotkey >? RemovedHotkey
 Occurs when a hotkey is removed from the list for any reason. More...
 

Detailed Description

Manages a list of Hotkey instances.

Constructor & Destructor Documentation

◆ HotkeyManager() [1/2]

VolumeControl.Core.Input.HotkeyManager.HotkeyManager ( HotkeyActionManager  actionManager)

Creates a new HotkeyManager instance from the specified actionManager .

Parameters
actionManagerA HotkeyActionManager instance to use for managing hotkey actions.

◆ HotkeyManager() [2/2]

VolumeControl.Core.Input.HotkeyManager.HotkeyManager ( )

Creates a new HotkeyManager instance with a new Actions.HotkeyActionManager instance.

Member Function Documentation

◆ AddHotkey()

void VolumeControl.Core.Input.HotkeyManager.AddHotkey ( Hotkey  hotkey)

Adds the specified hotkey to the manager.

Parameters
hotkeyA Hotkey instance to add to the list of managed hotkeys.
Exceptions
ArgumentExceptionThe hotkey is already being managed by this HotkeyManager.

References VolumeControl.Core.Input.HotkeyManager.Hotkeys, and VolumeControl.Core.Input.Hotkey.Registering.

Referenced by VolumeControl.Core.Input.HotkeyManager.AddJsonHotkeys< THotkey >().

Here is the caller graph for this function:

◆ AddJsonHotkeys< THotkey >()

void VolumeControl.Core.Input.HotkeyManager.AddJsonHotkeys< THotkey > ( params JsonHotkey[]  hotkeyJsonObjects)

Creates and adds a Hotkey for each element of the specified hotkeyJsonObjects .

Template Parameters
THotkeyA type derived from Hotkey to create. Specifying this allows you to substitute derived types in place of the default Hotkey type.
Parameters
hotkeyJsonObjectsThe JSON object representation of any number of Hotkeys.
Type Constraints
THotkey :Hotkey 

References VolumeControl.Core.Input.HotkeyManager.AddHotkey(), and VolumeControl.Core.Input.HotkeyManager.HotkeyActionManager.

Referenced by VolumeControl.Core.Input.HotkeyManager.SetHotkeysFromJsonHotkeys< THotkey >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ClearHotkeys()

void VolumeControl.Core.Input.HotkeyManager.ClearHotkeys ( )

Removes all hotkeys from the manager.

References VolumeControl.Core.Input.HotkeyManager.Hotkeys, and VolumeControl.Core.Input.HotkeyManager.RemoveHotkey().

Referenced by VolumeControl.Core.Input.HotkeyManager.SetHotkeysFromJsonHotkeys< THotkey >().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetHotkey()

Hotkey? VolumeControl.Core.Input.HotkeyManager.GetHotkey ( ushort  id)

Gets the Hotkey with the specified id .

Parameters
idThe unique ID number of the hotkey to get.
Returns
The Hotkey instance with the specified id number if found; otherwise null.

◆ GetJsonHotkeys()

virtual JsonHotkey [] VolumeControl.Core.Input.HotkeyManager.GetJsonHotkeys ( )
virtual

Gets a list of JsonHotkey instances for the list of managed hotkeys.

Returns
An array of JsonHotkey instances.

References VolumeControl.Core.Input.HotkeyManager.Hotkeys.

◆ RemoveHotkey() [1/2]

bool VolumeControl.Core.Input.HotkeyManager.RemoveHotkey ( Hotkey  hotkey)

Removes the specified hotkey from the manager.

Parameters
hotkeyA Hotkey instance to remove from the list of managed hotkeys.
Returns
true when the hotkey was successfully removed; otherwise false.
Exceptions
ArgumentExceptionThe hotkey is not being managed by this HotkeyManager.

References VolumeControl.Core.Input.Hotkey.Dispose(), VolumeControl.Core.Input.HotkeyManager.Hotkeys, and VolumeControl.Core.Input.Hotkey.Registering.

Referenced by VolumeControl.Core.Input.HotkeyManager.ClearHotkeys().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveHotkey() [2/2]

bool VolumeControl.Core.Input.HotkeyManager.RemoveHotkey ( ushort  id)

Removes the hotkey with the specified id from the manager.

Parameters
idThe unique ID number of a hotkey to remove.
Returns
true when the hotkey was successfully removed; otherwise false.
Exceptions
ArgumentExceptionThe hotkey with id is not being managed by this HotkeyManager.

◆ SetHotkeysFromJsonHotkeys< THotkey >()

Sets the list of managed hotkeys from the specified hotkeyJsonObjects .

Template Parameters
THotkeyA type derived from Hotkey to create. Specifying this allows you to substitute derived types in place of the default Hotkey type.
Parameters
hotkeyJsonObjectsThe JSON object representation of any number of Hotkeys.
Type Constraints
THotkey :Hotkey 

References VolumeControl.Core.Input.HotkeyManager.AddJsonHotkeys< THotkey >(), and VolumeControl.Core.Input.HotkeyManager.ClearHotkeys().

Here is the call graph for this function:

Property Documentation

◆ HookAbstractors

IReadOnlyList<HotkeyMessageHookAbstractor> VolumeControl.Core.Input.HotkeyManager.HookAbstractors
get

Gets the list of HotkeyMessageHookAbstractor instances that are currently active.

◆ HotkeyActionManager

HotkeyActionManager VolumeControl.Core.Input.HotkeyManager.HotkeyActionManager
get

Gets the action manager instance for this HotkeyManager.

Referenced by VolumeControl.Core.Input.HotkeyManager.AddJsonHotkeys< THotkey >().

◆ Hotkeys

Event Documentation

◆ AddedHotkey

EventHandler<Hotkey>? VolumeControl.Core.Input.HotkeyManager.AddedHotkey

Occurs when a hotkey is added to the list for any reason.

◆ RemovedHotkey

EventHandler<Hotkey>? VolumeControl.Core.Input.HotkeyManager.RemovedHotkey

Occurs when a hotkey is removed from the list for any reason.


The documentation for this class was generated from the following file: