public static async Task SaveAsync() { var file = await FileStorageProvider.GetFileAsync(); var lines = Actions.OrderBy(i => i.Index).Select(i => ActionItemAdapter.ToString(i)); await FileIO.WriteLinesAsync(file, lines); }
public static async Task ReloadAsync() { ActionItemManager.Actions.Clear(); var file = await FileStorageProvider.GetFileAsync(); if (file != null) { var lines = await FileIO.ReadLinesAsync(file); for (int index = 0; index < lines.Count; index++) { var line = lines[index]; if (line.Trim().Length > 0) { ActionItem actionItem = new ActionItem(line, index); if (!Actions.ContainsValue(actionItem)) { Actions.Add(actionItem); } } } } }