Ejemplo n.º 1
0
        private void button5_Click(object sender, EventArgs e)
        {
            //disable macros while editing, and restore previous value when done.
            _opTmpDisableMacro = true;
            if (editor == null)
            {
                editor = new frmAddMacro();
            }
            if (GetSelectedMacro() == null)
            {
                goto exit;
            }

            editor.EditMacro(GetSelectedMacro(), _macroPages.Where((item, idx) => (idx != _editingPage))
                             .Select((x) => x.name).ToArray());                         //filter out the current page from the list of pages.
            editor.ShowDialog();

            if (editor.DialogResult == DialogResult.OK && editor.HasEditedMacro)
            {
                SetSelectedMacro(editor.GetMacro());
                SaveMacros();
                CompileAll();
            }



exit:
            _opTmpDisableMacro = false;
        }
Ejemplo n.º 2
0
        private void button4_Click(object sender, EventArgs e)
        {
            //add macro
            _opTmpDisableMacro = true;
            if (editor == null)
            {
                editor = new frmAddMacro();
            }

            editor.NewMacro(NewMacroName(), _macroPages.Where((item, idx) => (idx != _editingPage))
                            .Select((x) => x.name).ToArray());                          //get slow if many pages but meh. linq is so f*****g h0t
            editor.ShowDialog();

            if (editor.DialogResult == DialogResult.OK && editor.HasNewMacro)
            {
                AddMacro(editor.GetMacro());
            }
            SaveMacros();
            DisplayCurrentMacroPage();
            CompileAll();
            _opTmpDisableMacro = false;
        }