public async Task ExecuteLoadItemsCommandAsync() { IsBusy = true; try { ListWords.Clear(); var items = await DataStore.ReadDataBase(true); items = items.Reverse(); foreach (var item in items) { ListWords.Add(item); } LastWordAdd = ListWords[0].DateTime; CountWords = ListWords.Count; OnPropertyChanged("LastWordAdd"); OnPropertyChanged("CountWords"); } finally { IsBusy = false; } }
public static async void InitLoadSet() { string fileContent; Uri uri = new Uri("ms-appx:///Data/Sets.txt"); file = await StorageFile.GetFileFromApplicationUriAsync(uri); StreamReader sRead = new StreamReader(await file.OpenStreamForReadAsync()); fileContent = await sRead.ReadLineAsync(); KeyValuePair<int, object> res = Type(fileContent); ListWords currentListWords = new ListWords(); while (res.Key != -1) { if (res.Key == 0) { currentListWords.Name = (string)res.Value; SetsNames.Add((string)res.Value); } if (res.Key == 1) { currentListWords.Add((Word)res.Value); } if (res.Key == 2) { SetsWords.Add(currentListWords.Name, currentListWords); currentListWords = new ListWords(); } fileContent = sRead.ReadLineAsync().Result; res = Type(fileContent); } MainPage.CurrentListWords = SetsWords["None"]; sRead.Dispose(); }
private bool CheckIsFinite() { words = new List <string>(); hasLoop = false; List <State> initial_States = ListStates.FindAll(x => x.IsInitial); foreach (var initial in initial_States) { List <Transition> used_transitions = new List <Transition>(); bool hasloop = false; GetWord(initial, used_transitions, hasloop); } if (hasLoop) { return(false); } foreach (var item in words) { ListWords.Add(new Word(item)); } return(true); }