public void LoadCourseTable() { //ImportDataFromCouseTableXlsx(); //strdayofweek maybe (if en-US)MONDAY, TUESDAY.. ,(if tr-TR)PAZARTESİ, SALI... etc. string strdayofweek = DateTime.Today.ToString("dddd").ToUpper(); var x = SchoolTimeSpanManager.schoolTimeSpansByWeekDay(strdayofweek); listViewCourseTable.ItemsSource = x; }
//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(); } }
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"); } }