Ejemplo n.º 1
0
        private void editBindingButton_Click(object sender, EventArgs e)
        {
            // returns a string form of the given keybinding or
            // null if no text was inputted to the text box;
            //usage:
            using (KeyBindForm keyForm = new KeyBindForm())
            {
                if (DialogResult.OK == keyForm.ShowDialog())
                {
                    string gestureName = keyForm.getGestureName();
                    string appName     = keyForm.getAppName();

                    if (keyForm.getKeyBind() != null && keyForm.getKeyBind().Trim() != "" &&
                        keyForm.getGestureName() != null && keyForm.getAppName() != null)
                    {
                        Gestures.setAppKeyForGesture(gestureName, appName, keyForm.getKeyBind());
                        Gestures.saveData();
                        gestureDataGridView.Hide();
                        gestureDataGridView.Controls.Clear();
                        LoadTable();
                        gestureDataGridView.Show();
                    }
                    //label1.Text = mainForm.getKeyBind();
                }
                else
                {
                    //nothing was found
                }
            }
        }
Ejemplo n.º 2
0
        private void editBindingButton_Click(object sender, EventArgs e)
        {
            // returns a string form of the given keybinding or 
            // null if no text was inputted to the text box;
            //usage: 
            using (KeyBindForm keyForm = new KeyBindForm())
            {
                if (DialogResult.OK == keyForm.ShowDialog())
                {
                    string gestureName = keyForm.getGestureName();
                    string appName = keyForm.getAppName();

                    if (keyForm.getKeyBind() != null && keyForm.getKeyBind().Trim() != "" 
                        && keyForm.getGestureName() != null && keyForm.getAppName() != null)
                    {
                        Gestures.setAppKeyForGesture(gestureName, appName, keyForm.getKeyBind());
                        Gestures.saveData();
                        gestureDataGridView.Hide();
                        gestureDataGridView.Controls.Clear();
                        LoadTable();
                        gestureDataGridView.Show();
                    }
                    //label1.Text = mainForm.getKeyBind();
                }
                else
                {
                    //nothing was found
                }

            }
        }