Beispiel #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;
        }
Beispiel #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;
        }
Beispiel #3
0
 public Account(Octokit.Account account, IObservable <BitmapSource> bitmapSource)
     : this(account)
 {
     bitmapSource.ObserveOn(RxApp.MainThreadScheduler)
     .Subscribe(x => Avatar = x);
 }
Beispiel #4
0
 public static AccountCacheItem Create(Account apiAccount)
 {
     return(new AccountCacheItem(apiAccount));
 }