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 }); }
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); }
private void OnCarStarted() { EngineStarted?.Invoke(this); }
public void Start() { IsRunning = true; EngineStarted?.Invoke(this, EventArgs.Empty); }