/// <summary> /// Specifies a registrar with which to register the hotkey. /// </summary> /// <param name="registrar"> /// The <see cref="IHotkeyRegistrar"/> with which the hotkey is /// to be registered. If null, the <see cref="DefaultRegistrar"/> /// is used. /// </param> /// <returns> /// A hotkey registered with the specified registrar. /// </returns> /// <exception cref="HotkeyException"> /// An error occured in registering the hotkey. Refer to /// documentation for the particular <see cref="IHotkeyRegistrar"/> /// in use. /// </exception> /// <exception cref="InvalidOperationException"> /// A <see cref="Hotkey"/> has already been built. /// </exception> public Builder For(IHotkeyRegistrar registrar) { _throwIfBuilt(); _registrar = registrar ?? DefaultRegistrar; return(this); }
public HotkeyUnitTests() { // Save initial value so we can reset to it between tests _defaultRegistrar = Hotkey.DefaultRegistrar; }
/// <summary> /// Create a new hotkey manager. /// </summary> public HotkeyManager() { registrar = HotkeyRegistrars.Windows; }
public void TestInit() { _registrar = HotkeyRegistrars.KeyEventSource.Create(_dummyEventSource); }
static Hotkey() { _defaultRegistrar = HotkeyRegistrars.Windows; }
public HotkeyRegistration(IHotkeyRegistrar registrar) { _registrar = registrar; }