Esempio n. 1
0
        private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            this.m_Timer.Stop();

            DateTime timerDailyStartTime = DateTime.Parse(DateTime.Today.ToShortDateString() + " 05:00");
            DateTime timerDailyEndTime   = DateTime.Parse(DateTime.Today.ToShortDateString() + " 18:00");

            this.m_MonitorPageWindow.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal,
                                                       new System.Action(
                                                           delegate()
            {
                if (DateTime.Now >= timerDailyStartTime && DateTime.Now <= timerDailyEndTime)
                {
                    this.m_Timer.Interval = TimerInterval;
                    if (this.UnreadAutopsyRequestExist() == false)
                    {
                        this.ShowNextPage();
                    }
                    else
                    {
                        this.ShowUnhandledAutopsyRequestPage();
                    }
                }
                else
                {
                    this.m_Timer.Interval = AfterHoursTimerInterval;
                    this.m_Timer.Start();

                    GoodNightPage goodNightPage = new GoodNightPage();
                    this.m_MonitorPageWindow.PageNavigator.Navigate(goodNightPage);
                }
            }));
        }
Esempio n. 2
0
        private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            this.m_Timer.Stop();

            DateTime timerDailyStartTime = DateTime.Parse(DateTime.Today.ToShortDateString() + " 05:00");
            DateTime timerDailyEndTime = DateTime.Parse(DateTime.Today.ToShortDateString() + " 18:00");

            this.m_MonitorPageWindow.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal,
                new System.Action(
                    delegate()
                    {
                        if (DateTime.Now >= timerDailyStartTime && DateTime.Now <= timerDailyEndTime)
                        {
                            this.m_Timer.Interval = TimerInterval;
                            if(this.UnreadAutopsyRequestExist() == true)
                            {
                                this.ShowUnhandledAutopsyRequestPage();

                            }
                            else if(this.m_LastReportDistributionHeartBeat < DateTime.Now.AddMinutes(-15))
                            {
                                this.ShowReportDistributionDownPage();
                            }
                            else
                            {
                                this.ShowNextPage();
                            }
                        }
                        else
                        {
                            this.m_Timer.Interval = AfterHoursTimerInterval;
                            this.m_Timer.Start();

                            GoodNightPage goodNightPage = new GoodNightPage();
                            this.m_MonitorPageWindow.PageNavigator.Navigate(goodNightPage);
                        }

                    }));
        }