コード例 #1
0
        protected virtual void OnEngineStarted()
        {
            FullyQualifiedName = GetType().FullName;
            Version            = AssemblyName.GetAssemblyName(Assembly.GetExecutingAssembly().Location).Version.ToString();

            StartTime = DateTimeOffset.Now;
            State     = EngineState.Normal;

            Logger.Info("The scheduler engine has started.");
            Logger.Info($"  Scheduler Type: {FullyQualifiedName}, Version: {Version}");

            EngineStarted?.Invoke(this, new EngineOperationEventArgs {
                State = State
            });
        }
コード例 #2
0
        private static void RunEngineStartedTimer()
        {
            if (engineStartedTimer != null)
            {
                engineStartedTimer.Dispose();
                engineStartedTimer = null;
            }

            engineStartedTimer = new Timer(delegate
            {
                if (CurrentIgnitionState == IgnitionState.Ign &&
                    CurrentRPM > 0 &&
                    EngineStarted != null)
                {
                    EngineStarted.Invoke();
                }
            }, null, 2000, 0);
        }
コード例 #3
0
 private void OnCarStarted()
 {
     EngineStarted?.Invoke(this);
 }
コード例 #4
0
 public void Start()
 {
     IsRunning = true;
     EngineStarted?.Invoke(this, EventArgs.Empty);
 }