示例#1
0
        void Initialize()
        {
            DrawLogo();

            Deserializer decoder       = TryInitStorageDecoder();
            bool         hasStoredData = decoder != null;

            sch     = new Scheduler();
            runtime = null;

            if (decoder != null)
            {
                try
                {
                    decoder.ReadObject(Log.D);
                    decoder.ReadObject(timerController = new TimerController());
                    decoder.ReadObject(runtime         = new RuntimeTask(timerController));
                    decoder.ReadObject(VariablesStorage.Shared);
                    decoder.ReadObject(CMMapper.Shared);
                }
                catch (Exception e)
                {
                    hasStoredData = false;
                    Log.WriteFormat(LOG_CAT, LogLevel.Error, "state restoring failed: {0}", e.ToString());
                }

                decoder.Dispose();
            }

            if (!hasStoredData)
            {
                LogLevels();
                timerController = new TimerController();
                runtime         = new RuntimeTask(timerController);
                VariablesStorage.Clear();
                CMMapper.Shared.Clear();

                ScheduleParse(true);
            }
        }
示例#2
0
        //*** Scheduller Task


        public RuntimeTask(TimerController timerController) : base("Runtime")
        {
            priority             = 3;
            this.timerController = timerController;
        }