예제 #1
0
        private async void frmMain_Load(object sender, EventArgs e)
        {
            await ShortKeyConfiguration.Start();

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

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

            RefreshMenuItems();
        }
예제 #5
0
 private void openStoragePathToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (ShortKeyConfiguration.GetDefaultConfigurationDirectory().Length > 0)
     {
         Process.Start(ShortKeyConfiguration.GetDefaultConfigurationDirectory());
     }
 }
예제 #6
0
        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();
            }
        }
예제 #7
0
        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();
                }
            }
        }
예제 #8
0
 private void RefreshBinding()
 {
     gridShortKeys.DataSource = null;
     gridShortKeys.DataSource = ShortKeyConfiguration.GetShortKeys();
 }
예제 #9
0
 private void flushKeysToLogToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ShortKeyConfiguration.FlushLogs();
 }
예제 #10
0
 private void RefreshMenuItems()
 {
     openStoragePathToolStripMenuItem.Enabled = ShortKeyConfiguration.GetDefaultConfigurationDirectory().Length > 0;
     logKeysdebugToolStripMenuItem.Checked    = ShortKeyConfiguration.Default.LogKeysDebug;
     flushKeysToLogToolStripMenuItem.Enabled  = ShortKeyConfiguration.Default.LogKeysDebug;
 }
예제 #11
0
        private async void btnRemove_Click(object sender, EventArgs e)
        {
            await ShortKeyConfiguration.RemoveShortKey(GetSelectedItem());

            RefreshBinding();
        }