예제 #1
0
        private void CmdEdit_Click(object sender, EventArgs e)
        {
            var cfg = mConfigs[Macros.SelectedIndex];
            var dlg = new CommandConfigEditor(mSpaceClaim, cfg);

            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            // update config with new values
            cfg.Hint         = dlg.CmdHint.Text;
            cfg.Image        = dlg.BrowseIcon.FileName;
            cfg.SpecFileName = (string)dlg.Macros.SelectedValue;
            cfg.Text         = dlg.CmdText.Text;

            mDirty = true;
            UpdateUserInterface();
        }
예제 #2
0
        private void CmdAdd_Click(object sender, EventArgs e)
        {
            var dlg = new CommandConfigEditor(mSpaceClaim);

            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            var cfg = new CommandConfig
            {
                Hint         = dlg.CmdHint.Text,
                Image        = dlg.BrowseIcon.FileName,
                SpecFileName = (string)dlg.Macros.SelectedValue,
                Text         = dlg.CmdText.Text
            };

            mConfigs.Add(cfg);

            mDirty = true;
            UpdateUserInterface();
        }