コード例 #1
0
 public List<Issue> Search(Project project, Sprint sprint)
 {
     var connection = this.youTrackClientFactory.CreateConnection();
     var result = connection.Execute<IssueResponce>(
         new SearchIssueRequest(string.Format("#{0} Fix versions: {1}", project.Name, sprint.Name)));
     return result.Data.Issue;
 }
コード例 #2
0
        public ProjectDetailsViewModel(
            Project project, 
            Sprint sprint, 
            Func<Project, Sprint, Person, PersonDetailsViewModel> personDetailsFactory
            )
        {
            _project = project;

            Name = _project.Name;

            PersonDetails = new ObservableCollection<PersonDetailsViewModel>(
                _project.People.Select(p=>personDetailsFactory(project,sprint,p))
                );
        }
コード例 #3
0
 public CommitsViewModel(
     Person person,
     Sprint sprint,
     SvnCommitRepository commitRepository,
     Func<SvnCommit, CommitViewModel> commitViewModelFactory
     )
 {
     this.Commits = new ObservableCollection<CommitViewModel>();
     this.ShowHeader = Visibility.Collapsed;
     commitRepository.ListCommitsObservable(TimeSpan.FromDays(7)).ObserveOnDispatcher().Subscribe(
         result =>
             {
                 this.Commits.Clear();
                 foreach (var eventArg in result.Where(r=>r.Author.Contains(person.Login)))
                 {
                     this.Commits.Add(commitViewModelFactory(eventArg));
                 }
                 ShowHeader = this.Commits.Any() ? Visibility.Visible : Visibility.Collapsed;
             });
 }
コード例 #4
0
        public PersonDetailsViewModel(Project project, 
            Sprint sprint,
            Person person,

            UserRepository userRepository,
            IssueRepository issueRepository,
            Func<IEnumerable<Issue>, IssueStatisticsViewModel> issueStatisticsFactory,
            Func<Sprint, Person, CommitsViewModel> commitsFactory
            )
        {
            _userRepository = userRepository;
            this.issueRepository = issueRepository;
            _issueStatisticsFactory = issueStatisticsFactory;
            Person = person;

            issueRepository.SearchObservable(project, sprint)
                           .Subscribe(r =>
                                    IssueStatistics = issueStatisticsFactory(r.Where(issue =>issue.Assignee != null && issue.Assignee.Login == person.Login))
                            );

            Commits = commitsFactory(sprint, person);
        }
コード例 #5
0
 public void Select(Sprint sprint)
 {
     _shell.Navigate(_projectDetailsFactory(_project,sprint));
 }
コード例 #6
0
 public IObservable<List<Issue>> SearchObservable(Project project, Sprint sprint)
 {
     return this.CacheCallObservable(() => this.Search(project, sprint));
 }