private void WriteUserInfo(string file, UserInfoDataPackage userInfoDataPackage) { using (StreamWriter sw = new StreamWriter(file)) { sw.WriteLine(JsonConvert.SerializeObject(userInfoDataPackage)); } }
public void SaveUserInfo(string file) { List <DataEntry> dataEntrySortedSet = new List <DataEntry>(dataEntryByDate); List <string> tagSortedSet = new List <string>(tags.ExportTagSet()); UserInfoDataPackage userInfoDataPackage = new UserInfoDataPackage(ref dataEntrySortedSet, ref tagSortedSet); WriteUserInfo(file, userInfoDataPackage); }
public void LoadUserInfo(string file) { UserInfoDataPackage userInfoDataPackage = ReadUserInfo(file); dataEntryByDate = new SortedSet <DataEntry>(userInfoDataPackage.DataEntries, new ComparerDataEntryByDate()); dataEntryByValue = new SortedSet <DataEntry>(dataEntryByDate, new ComparerDataEntryByValue()); dataEntryByDateCreated = new SortedSet <DataEntry>(dataEntryByDate, new ComparerDataEntryByDateCreated()); tags.ImportTagSet(new SortedSet <string>(userInfoDataPackage.Tags)); Console.WriteLine(tags.GetCount()); }