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