Esempio n. 1
0
        public static void StartProgram(IMatrixProgram program)
        {
            if (timer == null)
            {
                timer          = new Timer();
                timer.Interval = 100;
                timer.Elapsed += (s, a) =>
                {
                    ActiveProgram.UpdateProgram();
                    ViewChanged?.Invoke();
                };
            }

            if (ActiveProgram != null)
            {
                StopActiveProgram();
            }
            program.LoadProgram((s, a) =>
            {
                program.StartProgram();
                timer.Start();
                ViewChanged?.Invoke();
            });
            ActiveProgram = program;
            ViewChanged?.Invoke();
        }
Esempio n. 2
0
 public static void StopActiveProgram()
 {
     ActiveProgram = null;
     timer.Stop();
     ViewChanged?.Invoke();
 }