/// <summary> /// Handles the HotKeyPress event of the osHotKey control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void osHotKey_HotKeyPress(object sender, EventArgs e) { if (this._isWindowOpen) { return; } try { this._isWindowOpen = true; using (InstantNotesDialog iaf = new InstantNotesDialog()) { NativeMethods.SetForegroundWindow(iaf); NativeMethods.SetFocus(iaf); iaf.ShowDialog(); } } finally { this._isWindowOpen = false; } }
/// <summary> /// Handles the HotKeyPress event of the osHotKey control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void osHotKey_HotKeyPress(object sender, EventArgs e) { if(this._isWindowOpen) return; try { this._isWindowOpen = true; using (InstantNotesDialog iaf = new InstantNotesDialog()) { NativeMethods.SetForegroundWindow(iaf); NativeMethods.SetFocus(iaf); iaf.ShowDialog(); } } finally { this._isWindowOpen = false; } }