Ejemplo n.º 1
0
        public async Task ClosedIncrementalLoad()
        {
            ClosedPaginationIndex++;
            IsIncrementalLoadingClosed = true;
            var PRs = await RepositoryUtility.GetAllPullRequestsForRepo(Repository.Id, new PullRequestRequest
            {
                State = ItemStateFilter.Closed
            },
                                                                        ClosedPaginationIndex);

            IsIncrementalLoadingClosed = false;

            if (PRs != null)
            {
                if (PRs.Count > 0)
                {
                    foreach (var i in PRs)
                    {
                        ClosedPullRequests.Add(i);
                    }
                }
                else
                {
                    //no more issues left to load
                    ClosedPaginationIndex = -1;
                }
            }
        }
Ejemplo n.º 2
0
        public async Task Load(Repository repository)
        {
            if (!GlobalHelper.IsInternet())
            {
                //Sending NoInternet message to all viewModels
                Messenger.Default.Send(new GlobalHelper.LocalNotificationMessageType {
                    Message = "No Internet", Glyph = "\uE704"
                });
            }
            else
            {
                Repository = repository;

                /*Clear off Pull Requests of the previous repository*/
                if (OpenPullRequests != null)
                {
                    OpenPullRequests.Clear();
                }
                if (ClosedPullRequests != null)
                {
                    ClosedPullRequests.Clear();
                }

                IsLoadingOpen    = true;
                OpenPullRequests = await RepositoryUtility.GetAllPullRequestsForRepo(Repository.Id, new PullRequestRequest
                {
                    State = ItemStateFilter.Open
                });

                IsLoadingOpen = false;

                ZeroOpenPullRequests = OpenPullRequests.Count == 0 ? true : false;
            }
        }
Ejemplo n.º 3
0
        public async Task Load(Repository repository)
        {
            if (GlobalHelper.IsInternet())
            {
                Repository          = repository;
                OpenPaginationIndex = ClosedPaginationIndex = 0;

                /*Clear off Pull Requests of the previous repository*/
                if (OpenPullRequests != null)
                {
                    OpenPullRequests.Clear();
                }
                if (ClosedPullRequests != null)
                {
                    ClosedPullRequests.Clear();
                }

                IsLoadingOpen = true;
                OpenPaginationIndex++;
                OpenPullRequests = await RepositoryUtility.GetAllPullRequestsForRepo(Repository.Id, new PullRequestRequest
                {
                    State = ItemStateFilter.Open
                },
                                                                                     OpenPaginationIndex);

                IsLoadingOpen = false;

                ZeroOpenPullRequests = OpenPullRequests.Count == 0 ? true : false;
            }
        }