コード例 #1
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (SelectedMacro == null)
            {
                return;
            }

            MacroForm form = new MacroForm(SelectedMacro);

            var result = form.ShowDialog();

            if (result == DialogResult.Cancel)
            {
                return;
            }

            //dito save new macro
            DataContext.Instance.SaveData();
            RefreshBindings();
            Refresh_Datagrid();
        }
コード例 #2
0
        private void btnInsertMacro_Click(object sender, EventArgs e)
        {
            if (DataContext.Instance.SelectedMacroSet.Name == null)
            {
                MessageBox.Show("Select a Macro Set first.");

                return;
            }
            Macro     newMacro = new Macro();
            MacroForm form     = new MacroForm(newMacro);

            var result = form.ShowDialog();

            if (result == DialogResult.Cancel)
            {
                return;
            }

            //dito save new macro
            DataContext.Instance.SelectedMacroSet.InsertMacro(newMacro);
            DataContext.Instance.SaveData();
            RefreshBindings();
            Refresh_Datagrid();
        }