Ejemplo n.º 1
0
        public AccountCacheItem(Account account)
        {
            Login  = account.Login;
            IsUser = (account as User) != null;
            Uri htmlUrl;

            IsEnterprise = Uri.TryCreate(account.HtmlUrl, UriKind.Absolute, out htmlUrl) &&
                           !HostAddress.IsGitHubDotComUri(htmlUrl);
            PrivateRepositoriesInPlanCount = account.Plan != null ? account.Plan.PrivateRepos : 0;
            OwnedPrivateRepositoriesCount  = account.OwnedPrivateRepos;
            AvatarUrl = account.AvatarUrl;
        }
Ejemplo n.º 2
0
        public Account(Octokit.Account account)
        {
            Login  = account.Login;
            IsUser = (account as User) != null;
            Uri htmlUrl;

            IsEnterprise = Uri.TryCreate(account.HtmlUrl, UriKind.Absolute, out htmlUrl) &&
                           !HostAddress.IsGitHubDotComUri(htmlUrl);
            PrivateReposInPlan            = account.Plan != null ? account.Plan.PrivateRepos : 0;
            OwnedPrivateRepos             = account.OwnedPrivateRepos;
            IsOnFreePlan                  = PrivateReposInPlan == 0;
            HasMaximumPrivateRepositories = OwnedPrivateRepos >= PrivateReposInPlan;
        }
Ejemplo n.º 3
0
 public Account(Octokit.Account account, IObservable <BitmapSource> bitmapSource)
     : this(account)
 {
     bitmapSource.ObserveOn(RxApp.MainThreadScheduler)
     .Subscribe(x => Avatar = x);
 }
Ejemplo n.º 4
0
 public static AccountCacheItem Create(Account apiAccount)
 {
     return(new AccountCacheItem(apiAccount));
 }