public static ObservableCollection <SessionModel> GetSessions(int profileId) { ObservableCollection <SessionModel> sessionLoaded = new ObservableCollection <SessionModel>(); foreach (var item in PathManager.GetSessionsInfoFilesPaths(profileId)) { sessionLoaded.Add((SessionModel)JsonSerDer.LoadObject <SessionModel>(item)); } // var profilesSorted = sessionLoaded.OrderBy(x => x.Id).ToList(); return(sessionLoaded); }
public static List <ProfileModel> GetProfiles() { List <ProfileModel> profilesLoaded = new List <ProfileModel>(); foreach (var item in PathManager.GetProfilesInfoFilesPaths()) { profilesLoaded.Add((ProfileModel)JsonSerDer.LoadObject <ProfileModel>(item)); } var profilesSorted = profilesLoaded.OrderBy(x => x.Id).ToList(); return(profilesSorted); }
public static void SaveProfile(ProfileModel profile) { JsonSerDer.SaveObject(profile, PathManager.GetProfilePath(profile.Id)); }
public static void SaveSession(int profileId, SessionModel session) { JsonSerDer.SaveObject(session, PathManager.GetSessionInfoPath(profileId, session.Id)); }