Beispiel #1
0
        private void GoToNotification(NotificationItemViewModel item)
        {
            var x       = item.Notification;
            var subject = x.Subject.Type.ToLower();

            if (subject.Equals("issue"))
            {
                var node = x.Subject.Url.Substring(x.Subject.Url.LastIndexOf('/') + 1);
                var vm   = this.CreateViewModel <IssueViewModel>();
                vm.RepositoryOwner = x.Repository.Owner.Login;
                vm.RepositoryName  = x.Repository.Name;
                vm.Id = int.Parse(node);
                NavigateTo(vm);
            }
            else if (subject.Equals("pullrequest"))
            {
                var node = x.Subject.Url.Substring(x.Subject.Url.LastIndexOf('/') + 1);
                var vm   = this.CreateViewModel <PullRequestViewModel>();
                vm.RepositoryOwner = x.Repository.Owner.Login;
                vm.RepositoryName  = x.Repository.Name;
                vm.Id = int.Parse(node);
                NavigateTo(vm);
            }
            else if (subject.Equals("commit"))
            {
                var node = x.Subject.Url.Substring(x.Subject.Url.LastIndexOf('/') + 1);
                var vm   = this.CreateViewModel <CommitViewModel>();
                vm.RepositoryOwner = x.Repository.Owner.Login;
                vm.RepositoryName  = x.Repository.Name;
                vm.Node            = node;
                NavigateTo(vm);
            }
            else if (subject.Equals("release"))
            {
                var vm = this.CreateViewModel <BranchesAndTagsViewModel>();
                vm.RepositoryOwner = x.Repository.Owner.Login;
                vm.RepositoryName  = x.Repository.Name;
                vm.SelectedFilter  = BranchesAndTagsViewModel.ShowIndex.Tags;
                NavigateTo(vm);
            }

            ReadNotification(x);
        }
        private void GoToNotification(NotificationItemViewModel item)
        {
            var x = item.Notification;
            var subject = x.Subject.Type.ToLower();
            if (subject.Equals("issue"))
            {
                var node = x.Subject.Url.Substring(x.Subject.Url.LastIndexOf('/') + 1);
                var vm = this.CreateViewModel<IssueViewModel>();
                vm.Init(x.Repository.Owner.Login, x.Repository.Name, int.Parse(node)); 
                NavigateTo(vm);
            }
            else if (subject.Equals("pullrequest"))
            {
                var node = x.Subject.Url.Substring(x.Subject.Url.LastIndexOf('/') + 1);
                var vm = this.CreateViewModel<PullRequestViewModel>();
                vm.Init(x.Repository.Owner.Login, x.Repository.Name, int.Parse(node)); 
                NavigateTo(vm);
            }
            else if (subject.Equals("commit"))
            {
                var node = x.Subject.Url.Substring(x.Subject.Url.LastIndexOf('/') + 1);
                var vm = this.CreateViewModel<CommitViewModel>();
                vm.RepositoryOwner = x.Repository.Owner.Login;
                vm.RepositoryName = x.Repository.Name;
                vm.Node = node;
                NavigateTo(vm);
            }
            else if (subject.Equals("release"))
            {
                var vm = this.CreateViewModel<BranchesAndTagsViewModel>();
                vm.RepositoryOwner = x.Repository.Owner.Login;
                vm.RepositoryName = x.Repository.Name;
                vm.SelectedFilter = BranchesAndTagsViewModel.ShowIndex.Tags;
                NavigateTo(vm);
            }

            ReadNotification(x).ToBackground();
        }
 private void DeleteNotification(NotificationItemViewModel item)
 {
     _notifications.Remove(item.Notification);
     ReadNotification(item.Notification).ToBackground();
 }
Beispiel #4
0
 private void DeleteNotification(NotificationItemViewModel item)
 {
     _notifications.Remove(item.Notification);
     ReadNotification(item.Notification).ToBackground();
 }