示例#1
0
        public async void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Pivot p = sender as Pivot;

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

                IsLoadingOpen = false;

                ZeroOpenPullRequests = OpenPullRequests.Count == 0 ? true : false;
            }
            else if (p.SelectedIndex == 1)
            {
                IsLoadingClosed = true;

                ClosedPullRequests = await RepositoryUtility.GetAllPullRequestsForRepo(Repository.Id, new PullRequestRequest
                {
                    State = ItemStateFilter.Closed
                });

                IsLoadingClosed = false;

                ZeroClosedPullRequests = ClosedPullRequests.Count == 0 ? true : false;
            }
        }
示例#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;
            }
        }
示例#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;
            }
        }
示例#4
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;
                }
            }
        }
示例#5
0
        public async void Pivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (Repository != null)
            {
                Pivot p = sender as Pivot;

                if (p.SelectedIndex == 0)
                {
                    IsLoadingOpen    = true;
                    OpenPullRequests = await RepositoryUtility.GetAllPullRequestsForRepo(Repository.Id, new PullRequestRequest
                    {
                        State = ItemStateFilter.Open
                    },
                                                                                         OpenPaginationIndex = 1);

                    IsLoadingOpen = false;

                    ZeroOpenPullRequests             = OpenPullRequests.Count == 0 ? true : false;
                    MaxOpenScrollViewerVerticalffset = 0;
                }
                else if (p.SelectedIndex == 1)
                {
                    IsLoadingClosed = true;

                    ClosedPullRequests = await RepositoryUtility.GetAllPullRequestsForRepo(Repository.Id, new PullRequestRequest
                    {
                        State = ItemStateFilter.Closed
                    },
                                                                                           ClosedPaginationIndex = 1);

                    IsLoadingClosed = false;

                    ZeroClosedPullRequests             = ClosedPullRequests.Count == 0 ? true : false;
                    MaxClosedScrollViewerVerticalffset = 0;
                }
            }
        }