private async void frmMain_Load(object sender, EventArgs e)
        {
            await ShortKeyConfiguration.Start();

            txtSuffix.Text = ShortKeyConfiguration.Default.Prefix;
            RefreshAll();
        }
 public void SetShortKey(ShortKey key, bool newShortKey)
 {
     cbxCategory.DataSource           = ShortKeyConfiguration.GetCategories();
     shortKeyBindingSource.DataSource = key;
     cbxCategory.Text    = key.Category;
     cbxCategory.Enabled = newShortKey;
 }
        private async void btnUpdate_Click(object sender, EventArgs e)
        {
            ShortKeyConfiguration.Default.Prefix = txtSuffix.Text;
            await ShortKeyConfiguration.Save();

            RefreshUpdateButton();
        }
        private async void logKeysdebugToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ShortKeyConfiguration.Default.LogKeysDebug = !ShortKeyConfiguration.Default.LogKeysDebug;
            await ShortKeyConfiguration.Save();

            RefreshMenuItems();
        }
 private void openStoragePathToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (ShortKeyConfiguration.GetDefaultConfigurationDirectory().Length > 0)
     {
         Process.Start(ShortKeyConfiguration.GetDefaultConfigurationDirectory());
     }
 }
        private async void btnAdd_Click(object sender, EventArgs e)
        {
            frmShortKey frm = new frmShortKey();

            frm.SetShortKey(new ShortKey(), true);
            if (frm.ShowDialog() == DialogResult.OK)
            {
                await ShortKeyConfiguration.AddShortKey(frm.GetShortKey());

                RefreshAll();
            }
        }
        private async void btnEdit_Click(object sender, EventArgs e)
        {
            if (gridShortKeys.SelectedRows.Count > 0)
            {
                frmShortKey frm = new frmShortKey();
                frm.SetShortKey(GetSelectedItem(), false);
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    await ShortKeyConfiguration.UpdateShortKey(frm.GetShortKey());

                    RefreshAll();
                }
            }
        }
 private void RefreshBinding()
 {
     gridShortKeys.DataSource = null;
     gridShortKeys.DataSource = ShortKeyConfiguration.GetShortKeys();
 }
 private void flushKeysToLogToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ShortKeyConfiguration.FlushLogs();
 }
 private void RefreshMenuItems()
 {
     openStoragePathToolStripMenuItem.Enabled = ShortKeyConfiguration.GetDefaultConfigurationDirectory().Length > 0;
     logKeysdebugToolStripMenuItem.Checked    = ShortKeyConfiguration.Default.LogKeysDebug;
     flushKeysToLogToolStripMenuItem.Enabled  = ShortKeyConfiguration.Default.LogKeysDebug;
 }
        private async void btnRemove_Click(object sender, EventArgs e)
        {
            await ShortKeyConfiguration.RemoveShortKey(GetSelectedItem());

            RefreshBinding();
        }