Ejemplo n.º 1
0
		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();
			}
		}
Ejemplo n.º 2
0
			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);
                }
			}
Ejemplo n.º 3
0
 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);
 }
Ejemplo n.º 4
0
 public async Task Validate(CodeFramework.Core.Data.IAccount account)
 {
     var githubAccount = (GitHubAccount)account;
     await _loginFactory.LoginAccount(githubAccount);
 }
Ejemplo n.º 5
0
 public FilterModel(CodeFramework.Core.Data.Filter filter)
 {
     Filter = filter;
     IssueModel = filter.GetData<IssuesFilterModel>();
 }