private void Window_Loaded(object sender, RoutedEventArgs e) { OpenCheckIn.Load(); Public.switchWindow = new SwitchWindow(); Public.switchWindow.Show(); Close(); }
private void Timer1000_Tick(object sender, EventArgs e) { if (Settings.Default.isCheckIn) { OpenCheckIn.Check(); } foreach (var item in windows) { if (item.Window is FunctionWindow window) { if (window.IsVisible && FunctionWindow.ColorActive) { window.ChangeColor(); } window.Topmost = true; } } Public.SettingWindow.TbChangeHeTime.Text = "长河时间 " + Public.ChangHeTime().ToString(); #if !DEBUG try { Core.Load(Public.pathTime, Public.pathClass); Core.CurrentTime = Public.ChangHeTime(); } catch (Exception ex) { ULogger.WriteException(ex); Public.timeTableWindow.ErrorLoad(); Public.classTableWindow.ErrorLoad(); return; } #else Core.Load(Public.pathTime, Public.pathClass); Core.CurrentTime = Public.ChangHeTime(); #endif //timeWindow.Topmost = true; Public.timeTableWindow.Changedata(Core.CurrentTimeSection, Core.FormatProgress(Core.Progress)); Public.timeTableWindow.MoveLineProgress(Core.Progress); Public.timeWindow.ChangeTime(); int week = (int)Public.ChangHeTime().DayOfWeek; if (Public.ChangHeTime().CompareTo(Core.LastClassEndTime[week]) > 0 && Settings.Default.isTomorrowClass) { //明天课表 Public.classTableWindow.ChangeClass(Core.GetClass((int)Public.ChangHeTime().AddDays(1).DayOfWeek), true); Public.classTableWindow.ChangeWeek(Public.ChangHeTime().AddDays(1).DayOfWeek); } else { //今天课表 Public.classTableWindow.ChangeClass(Core.GetClass()); Public.classTableWindow.ChangeWeek(Public.ChangHeTime().DayOfWeek); } }