public static async void DeleteReminder(Reminder reminder) { _reminders.RemoveAll(r => r == reminder); await SwinIO <List <Reminder> > .WriteAsync("reminders.json", User.Reminders); PopulateSchedule(); }
/// <summary> /// Load lesson data /// </summary> public static async void WriteReminder(Reminder reminder) { _reminders.Add(reminder); _reminders.Sort((r1, r2) => DateTime.Compare(r1.Time, r2.Time)); await SwinIO <List <Reminder> > .WriteAsync("reminders.json", _reminders); PopulateSchedule(); }
public static async void DeleteTimetabledClasses(List <TimetabledClass> cList) { foreach (TimetabledClass c in cList) { _classes.Remove(c); } await SwinIO <List <TimetabledClass> > .WriteAsync("classes.json", _classes); PopulateSchedule(); }
public static async void WriteTimetabledClasses(List <TimetabledClass> cList) { foreach (TimetabledClass c in cList) { _classes.Add(c); } _classes.Sort((r1, r2) => DateTime.Compare(r1.Time, r2.Time)); await SwinIO <List <TimetabledClass> > .WriteAsync("classes.json", _classes); PopulateSchedule(); }
/// <summary> /// Loads all data relating to the User including blackboard data, timetables, trains, reminders etc... /// </summary> public static void LoadUserData() { ClearDashItemsSafe(); AddDashItemSafe(new TextContentDashCard("Welcome to SwinApp", "Creators of SwinApp")); LoadUserTimetable(); if (USE_PROTOTYPE_DATA) { AddDashItemSafe(new TextContentDashCard("Remember, learning is fun", "Creators of SwinApp")); //AddDashItemSafe(_upNextCard); AddDashItemSafe(new WeatherCard()); } //if the file doesn't exist, set _reminders to be an empty List of Reminder _reminders = SwinIO <List <Reminder> > .Read("reminders.json") ?? new List <Reminder>(); _classes = SwinIO <List <TimetabledClass> > .Read("classes.json") ?? new List <TimetabledClass>(); PopulateSchedule(); }