示例#1
0
文件: CACore.cs 项目: jiman14/APODE
        /// <summary>
        /// Launch program from event
        /// </summary>
        /// <param name="event_desc"></param>
        private void Vm_runProgram(CEventDesc event_desc)
        {
            if (event_desc.Program != "")
            {
                Runner.LaunchProgram(event_desc);
            }

            // Run programs in queue
            while (Runner.Programs_in_queue)
            {
                Runner.LaunchProgramInQueue();
            }

            Sistema.reset_UI_errors();
        }
示例#2
0
        private void run()
        {
            String cmd = "";

            while ((cmd != EXIT_COMMAND) && (!exit))
            {
                cmd = Console.ReadLine();

                if (!String.IsNullOrEmpty(cmd))
                {
                    String[]   command      = cmd.Split(' ');
                    String     program_name = command[0];
                    CEventDesc eDesc        = new CEventDesc("", "", "", "", program_name);
                    eDesc.addArgs(new object[] { cmd.Replace(program_name + " ", "") });
                    runProgram(eDesc);
                }
            }
            exit = true;
        }
示例#3
0
        private void Tcron_Tick(object sender, EventArgs e)
        {
            // temporary desactive console dump
            debug.CONSOLE_DUMP = false;
            // run programs in list

            System.Windows.Forms.Timer tcron = (System.Windows.Forms.Timer)sender;
            tcron.Stop();

            if (runProgram != null)
            {
                CEventDesc desc = new CEventDesc("CRON CALL", "CRON CALL", "CRON CALL", "CRON CALL", tcron.Tag.ToString());
                runProgram(desc);
            }

            // restore console dump
            debug.CONSOLE_DUMP = true;
            // start cron
            if (program_list.Keys.Contains(tcron.Tag.ToString()))
            {
                tcron.Start();
            }
        }