Skip to content

Commit

Permalink
修复 Issue #24
Browse files Browse the repository at this point in the history
  • Loading branch information
STBBRD committed Aug 1, 2024
1 parent 79eeba1 commit 9244ab6
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions ZongziTEK_Blackboard_Sticker/TimetableEditor.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,17 @@ public partial class TimetableEditor : Window
{
public TimetableEditor()
{
InitializeComponent();
InitializeComponent();

if (File.Exists(MainWindow.GetDataPath() + MainWindow.timetableFileName))
{
try
{
string text = File.ReadAllText(MainWindow.GetDataPath() + MainWindow.timetableFileName);
Timetable = JsonConvert.DeserializeObject<Timetable>(text);
}
catch { }
}

AutoSelectTimetableToEdit();
}
Expand Down Expand Up @@ -175,16 +185,6 @@ private void ScrollViewerTimetable_PreviewMouseWheel(object sender, MouseWheelEv

private async void LoadTimetable()
{
if (File.Exists(MainWindow.GetDataPath() + MainWindow.timetableFileName))
{
try
{
string text = File.ReadAllText(MainWindow.GetDataPath() + MainWindow.timetableFileName);
Timetable = JsonConvert.DeserializeObject<Timetable>(text);
}
catch { }
}

TextBlockLessonCount.Text = GetSelectedDay().Count.ToString();

ListStackPanel.Children.Clear();
Expand Down

0 comments on commit 9244ab6

Please sign in to comment.