public async Task <int> RefreshAndGetStashCount() { StashItems.Clear(); if (_gitRepository.TryGetTarget(out IGitRepository gitRepository) == false) { return(0); } string cmd = GitCommandCreator.StashList(); List <string> outputs = await gitRepository.CreateGitRunner().RunAsync(cmd); foreach (string line in outputs) { if (string.IsNullOrEmpty(line.Trim())) { continue; } var parsedResult = GitStashListParser.Parse(line); StashItem stashItem = new StashItem(); stashItem.Name = parsedResult.Name; stashItem.Base = parsedResult.Marker; stashItem.Description = parsedResult.Description; StashItems.Add(stashItem); } NotifyPropertyChanged("StashItems"); return(StashItems.Count); }
private void updateForLeague() { var tabs = ApplicationState.Stash[ApplicationState.CurrentLeague].Tabs; StashItems = tabs.Select(t => new TabInfo() { Name = t.Name, Url = t.srcC, ID = t.i }).ToList(); StashItems.ForEach(s => s.FixName()); }
private void updateForLeague() { var space = ApplicationState.Stash[ApplicationState.CurrentLeague].CalculateFreeSpace(); space.Remove("All"); var betterSpace = space.ToDictionary(k => int.Parse(k.Key.Replace("Stash", "")) - 1, k => k.Value);; var tabs = ApplicationState.Stash[ApplicationState.CurrentLeague].Tabs; StashItems = tabs.Where(t => betterSpace.ContainsKey(t.i)).Select(t => new ExportStashInfo() { AvailableSpace = betterSpace[t.i], Name = t.Name, Url = t.srcC, ID = t.i }).ToList(); StashItems.ForEach(s => s.FixName()); }