Ejemplo n.º 1
0
 public void PrepareToRun(ConditionVariables v, ConditionFileHandles fh, Dictionary <string, Forms.ConfigurableForm> d, bool chae = true)
 {
     currentvars       = v;
     currentfiles      = fh;
     closehandlesatend = chae;
     functions         = new ConditionFunctions(currentvars, currentfiles);   // point the functions at our variables and our files..
     dialogs           = d;
 }
 public ConditionEDDFunctions(ConditionFunctions c, ConditionVariables v, ConditionFileHandles h, int recd) : base(c, v, h, recd)
 {
     if (functions == null)        // one time init, done like this cause can't do it in {}
     {
         functions = new Dictionary <string, FuncEntry>();
         functions.Add("systempath", new FuncEntry(SystemPath, 1, 1, 0, 0)); // literal
         functions.Add("version", new FuncEntry(Version, 1, 1, 0));          // don't check first para
     }
 }
Ejemplo n.º 3
0
        // now = true, run it immediately, else run at end of queue.  Optionally pass in handles and dialogs in case its a sub prog

        public void Run(bool now, ActionFile fileset, ActionProgram r, ConditionVariables inputparas,
                        ConditionFileHandles fh = null, Dictionary <string, ExtendedControls.ConfigurableForm> d = null, bool closeatend = true)
        {
            if (now)
            {
                if (progcurrent != null)                    // if running, push the current one back onto the queue to be picked up
                {
                    progqueue.Insert(0, progcurrent);
                }

                progcurrent = new ActionProgramRun(fileset, r, inputparas, this, actioncontroller);   // now we run this.. no need to push to stack

                progcurrent.PrepareToRun(new ConditionVariables(progcurrent.inputvariables, actioncontroller.Globals, fileset.filevariables),
                                         fh == null ? new ConditionFileHandles() : fh, d == null ? new Dictionary <string, ExtendedControls.ConfigurableForm>() : d, closeatend);              // if no filehandles, make them and close at end
            }
            else
            {
                progqueue.Add(new ActionProgramRun(fileset, r, inputparas, this, actioncontroller));
            }
        }
Ejemplo n.º 4
0
 static public ConditionFunctionHandlers DefaultGetCFH(ConditionFunctions c, ConditionVariables vars, ConditionFileHandles handles, int recdepth)
 {
     return(new ConditionEDDFunctions(c, vars, handles, recdepth));
 }