/// <summary>
        /// Handle the Click event of btnUnregister.
        /// </summary>
        private void btnUnregister_Click(object sender, EventArgs e)
        {
            // Dispose the hotKeyToRegister.
            if (hotKeyToRegister != null)
            {
                hotKeyToRegister.Dispose();
                hotKeyToRegister = null;
            }

            // Update the UI.
            tbHotKey.Enabled      = true;
            btnRegister.Enabled   = true;
            btnUnregister.Enabled = false;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 处理btnUnregister的Click事件。
        /// </summary>
        private void btnUnregister_Click(object sender, EventArgs e)
        {
            // 处理hotKeyToRegister。
            if (hotKeyToRegister != null)
            {
                hotKeyToRegister.Dispose();
                hotKeyToRegister = null;
            }

            // 更新界面。
            tbHotKey.Enabled      = true;
            btnRegister.Enabled   = true;
            btnUnregister.Enabled = false;
        }