Ejemplo n.º 1
0
        //DateTimeOffset _currentDate;
        //TimeSpan _currentTime;

        //DateTime _reportedTime;
        //DateTime _systemDateTime;



        public DashboardPage()
        {
            InitializeComponent();
            Current = this;

            setWorkingLocalPathTextBox();
            InitializeUpdater();

            rtctimer_ = new DispatcherTimer()
            {
                Interval = TimeSpan.FromSeconds(3)
            };
            rtctimer_.Tick += Rtctimer__Tick;
            rtctimer_.Start();



            if (SchoolTimeSpanManager.isSchoolTimeSpansEmpty())
            {
                SchoolTimeSpanManager.ImportDataFromCouseTableXlsx();
            }
        }
Ejemplo n.º 2
0
        private void ClockTimer_Tick(object sender, object e)
        {
            textBlockClock.Text = getNow();
            textBlockToday.Text = getTodayUpper(LocalizationUtils.GetDefaultCultureInforName());

            if (!SchoolTimeSpanManager.isSchoolTimeSpansEmpty())
            {
                string   strdayofweek = DateTime.Today.ToString("dddd").ToUpper();
                TimeSpan tsnow        = DateTime.Now.TimeOfDay;
                CourseTableRowIdxAndRemainingTime i_and_t;

                i_and_t = SchoolTimeSpanManager.IndexByTime(tsnow, SchoolTimeSpanManager.schoolTimeSpansByWeekDay(strdayofweek));

                try
                {
                    listViewCourseTable.SelectedIndex = i_and_t.idx;
                }
                catch
                {
                }

                TextBlockRemeainingTime.Text = i_and_t.RemainingTime.ToString(@"hh\:mm\:ss");
            }
        }