private void TmrPage_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            if (String.IsNullOrEmpty(initialAlertColor))
            {
                initialAlertColor = DEFAULT_ALERT_COLOR;
            }

            FlashStatusChanged?.Invoke(this, new FlashStatusEventArgs(Helpers.GenerateStageColor(initialAlertColor, alertStage, Helpers.TOTAL_ALERT_STAGES), PageMessage));
            alertStage = (alertStage + 1) % Helpers.TOTAL_ALERT_STAGES;
        }
        public void StopFlashAndReset()
        {
            Logger.Instance.LogMessage(TracingLevel.INFO, $"StopFlash called");
            tmrPage.Stop();

            if (FlashStatusChanged == null)
            {
                Logger.Instance.LogMessage(TracingLevel.WARN, "StopFlash called but FlashStatusChanged is null");
            }
            FlashStatusChanged?.Invoke(this, new FlashStatusEventArgs(Color.Empty, null));
            Thread.Sleep(100);
        }
        private void TmrPage_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            if (String.IsNullOrEmpty(currentPageInitialColor))
            {
                Logger.Instance.LogMessage(TracingLevel.WARN, "TmrPage: No alert color, reverting to default");
                currentPageInitialColor = DEFAULT_ALERT_COLOR;
            }

            Color shadeColor = GraphicsTools.GenerateColorShades(currentPageInitialColor, alertStage, Constants.ALERT_TOTAL_SHADES);

            FlashStatusChanged?.Invoke(this, new FlashStatusEventArgs(shadeColor, pageMessage));
            alertStage = (alertStage + 1) % Constants.ALERT_TOTAL_SHADES;
        }
        private void TmrPage_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            if (autoStopSeconds > 0 && (DateTime.Now - pageStartTime).TotalSeconds > autoStopSeconds)
            {
                Logger.Instance.LogMessage(TracingLevel.INFO, $"Auto stopping page after {(DateTime.Now - pageStartTime).TotalSeconds} seconds");
                StopFlashAndReset();
                connection.SwitchProfileAsync(null);
                return;
            }

            if (String.IsNullOrEmpty(currentPageInitialColor))
            {
                Logger.Instance.LogMessage(TracingLevel.WARN, "TmrPage: No alert color, reverting to default");
                currentPageInitialColor = DEFAULT_ALERT_COLOR;
            }

            Color shadeColor = GraphicsTools.GenerateColorShades(currentPageInitialColor, alertStage, Constants.ALERT_TOTAL_SHADES);

            FlashStatusChanged?.Invoke(this, new FlashStatusEventArgs(shadeColor, pageMessage));
            alertStage = (alertStage + 1) % Constants.ALERT_TOTAL_SHADES;
        }
 public void StopFlash()
 {
     Logger.Instance.LogMessage(TracingLevel.INFO, $"StopFlash called");
     tmrPage.Stop();
     FlashStatusChanged?.Invoke(this, new FlashStatusEventArgs(Color.Empty, null));
 }