Пример #1
0
        public async Task Load(Tuple <Repository, Issue> tuple)
        {
            Issue      = tuple.Item2;
            Repository = tuple.Item1;

            if (!GlobalHelper.IsInternet())
            {
                //Sending NoInternet message to all viewModels
                Messenger.Default.Send(new GlobalHelper.LocalNotificationMessageType {
                    Message = "No Internet", Glyph = "\uE704"
                });
            }
            else
            {
                isLoading = true;
                Comments  = await IssueUtility.GetAllCommentsForIssue(Repository.Id, Issue.Number);

                isLoading = false;

                if (Repository.Owner == null)
                {
                    Repository = await RepositoryUtility.GetRepository(Repository.Id);
                }

                if (Repository.Owner.Login == GlobalHelper.UserLogin || Issue.User.Login == GlobalHelper.UserLogin)
                {
                    CanEditIssue = true;
                }
                if (Repository.Owner.Login == GlobalHelper.UserLogin)
                {
                    IsMyRepo = true;
                }
            }
        }
Пример #2
0
        public async Task Load(Tuple <Repository, PullRequest> tuple)
        {
            PullRequest = tuple.Item2;
            Repository  = tuple.Item1;

            if (GlobalHelper.IsInternet())
            {
                isLoading   = true;
                PullRequest = await PullRequestUtility.GetPullRequest(Repository.Id, PullRequest.Number);

                Comments = await IssueUtility.GetAllCommentsForIssue(Repository.Id, PullRequest.Number);

                isLoading = false;
            }
        }
        public async void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Pivot p = sender as Pivot;

            if (p.SelectedIndex == 0)
            {
                isLoading = true;
                Comments  = await IssueUtility.GetAllCommentsForIssue(Repository.Id, PullRequest.Number);

                isLoading = false;
            }
            else if (p.SelectedIndex == 1)
            {
                IsLoadingCommits = true;
                Commits          = await PullRequestUtility.GetAllCommitsForPullRequest(Repository.Id, PullRequest.Number);

                IsLoadingCommits = false;
            }
        }
Пример #4
0
        public async Task Load(object param)
        {
            if (param as Tuple <Repository, Issue> != null)
            {
                var tuple = param as Tuple <Repository, Issue>;
                Issue      = tuple.Item2;
                Repository = tuple.Item1;
            }
            else
            {
                var tuple = (param as Tuple <string, string, Issue>);
                if (tuple != null)
                {
                    Issue      = tuple.Item3;
                    Repository = await RepositoryUtility.GetRepository(tuple.Item1, tuple.Item2);
                }
            }

            if (GlobalHelper.IsInternet())
            {
                if (Repository != null)
                {
                    isLoading = true;
                    Comments  = await IssueUtility.GetAllCommentsForIssue(Repository.Id, Issue.Number);

                    isLoading = false;

                    if (Repository.Owner == null)
                    {
                        Repository = await RepositoryUtility.GetRepository(Repository.Id);
                    }

                    if (Repository.Owner.Login == GlobalHelper.UserLogin || Issue.User.Login == GlobalHelper.UserLogin)
                    {
                        CanEditIssue = true;
                    }
                    if (Repository.Owner.Login == GlobalHelper.UserLogin)
                    {
                        IsMyRepo = true;
                    }
                }
            }
        }
        public async Task Load(Tuple <Repository, PullRequest> tuple)
        {
            PullRequest = tuple.Item2;
            Repository  = tuple.Item1;

            if (!GlobalHelper.IsInternet())
            {
                //Sending NoInternet message to all viewModels
                Messenger.Default.Send(new GlobalHelper.LocalNotificationMessageType {
                    Message = "No Internet", Glyph = "\uE704"
                });
            }
            else
            {
                isLoading   = true;
                PullRequest = await PullRequestUtility.GetPullRequest(Repository.Id, PullRequest.Number);

                Comments = await IssueUtility.GetAllCommentsForIssue(Repository.Id, PullRequest.Number);

                isLoading = false;
            }
        }