private static void CheckCacheSize(CodeFramework.Core.Data.AccountCache cache) { var totalCacheSize = cache.Sum(x => System.IO.File.Exists(x.Path) ? new System.IO.FileInfo(x.Path).Length : 0); var totalCacheSizeMB = ((float)totalCacheSize / 1024f / 1024f); if (totalCacheSizeMB > 64) { System.Console.WriteLine("Flushing cache due to size..."); cache.DeleteAll(); } }
public PinnedRepoElement(CodeFramework.Core.Data.PinnedRepository pinnedRepo, System.Windows.Input.ICommand command) : base(pinnedRepo.Name, () => command.Execute(new RepositoryIdentifier { Owner = pinnedRepo.Owner, Name = pinnedRepo.Name }), Images.Repo) { PinnedRepo = pinnedRepo; // BUG FIX: App keeps getting relocated so the URLs become off if (PinnedRepo.ImageUri.EndsWith("repository.png", System.StringComparison.Ordinal)) { Image = UIImage.FromFile("Images/repository.png"); } else if (PinnedRepo.ImageUri.EndsWith("repository_fork.png", System.StringComparison.Ordinal)) { Image = UIImage.FromFile("Images/repository_fork.png"); } else { ImageUri = new System.Uri(PinnedRepo.ImageUri); } }
public PinnedRepoElement(CodeFramework.Core.Data.PinnedRepository pinnedRepo, System.Windows.Input.ICommand command) : base(pinnedRepo.Name, () => command.Execute(new CodeHub.Core.Utils.RepositoryIdentifier { Owner = pinnedRepo.Owner, Name = pinnedRepo.Name }), Images.Repo) { PinnedRepo = pinnedRepo; ImageUri = new System.Uri(PinnedRepo.ImageUri); }
public async Task Validate(CodeFramework.Core.Data.IAccount account) { var githubAccount = (GitHubAccount)account; await _loginFactory.LoginAccount(githubAccount); }
public FilterModel(CodeFramework.Core.Data.Filter filter) { Filter = filter; IssueModel = filter.GetData<IssuesFilterModel>(); }