void LoadProgram(ActionProgram prog)
        {
            foreach (Group g in groups)
            {
                g.panel.Controls.Clear();
                panelVScroll.Controls.Remove(g.panel);
            }

            groups.Clear();

            curprog = new ActionProgram(prog.Name);

            initialprogname = textBoxBorderName.Text = prog.Name;

            SuspendLayout();
            panelVScroll.SuspendLayout();

            ActionBase ac;
            int        step = 0;

            while ((ac = prog.GetStep(step)) != null)
            {
                ActionBase ca = ActionBase.CreateCopy(ac);// COPY it.. so we can modify without altering current
                curprog.Add(ca);
                CreateStep(-1, ca);
                step++;
            }

            RepositionGroups();
            panelVScroll.ResumeLayout();
            ResumeLayout();
        }
示例#2
0
        public ActionProgramRun(ActionFile af,                          // associated file
                                ActionProgram r,                        // the program
                                ConditionVariables iparas,              // input variables to the program only.. not globals
                                ActionRun runner,                       // who is running it..
                                ActionCoreController ed) : base(r.Name) // allow a pause
        {
            actionfile           = af;
            actionrun            = runner;
            actioncontroller     = ed;
            execlevel            = 0;
            execstate[execlevel] = ExecState.On;
            nextstepnumber       = 0;

            //System.Diagnostics.Debug.WriteLine("Run " + actionfile.name + "::" + r.Name);
            //ActionData.DumpVars(gvars, " Func Var:");

            inputvars = iparas;             // current vars is set up by ActionRun at the point of invokation to have the latests globals

            List <ActionBase> psteps = new List <ActionBase>();
            ActionBase        ac;

            for (int i = 0; (ac = r.GetStep(i)) != null; i++)
            {
                psteps.Add(ActionBase.CreateCopy(ac));
            }

            programsteps = psteps;
        }
        private void copyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ActionProgramCopyBuffer.Clear();
            AddRightClickToMarkIfRequired();

            foreach (Group g in GetMarked())
            {
                ActionBase curact = curprog.GetStep(groups.IndexOf(g));
                if (curact != null)
                {
                    ActionProgramCopyBuffer.Add(ActionBase.CreateCopy(curact));
                }
            }

            UnMark();
        }