Exemplo n.º 1
0
        private async Task CloseAddProjectDialog()
        {
            await _dialogCoordinatorService.CloseDialog(_addProjectDialog);

            _addProjectDialog = null;
            SelectedProject   = new ProjectVO();
        }
        private async void LoadIssues(ProjectVO currentProjectVo, bool refresh = false)
        {
            if (currentProjectVo == null)
            {
                return;
            }

            CallMapper <GitlabProject>(currentProjectVo, project => _projectContentOrchestrator.SetupRepositoryOnCurrentProject(project));

            List <GitlabIssue> issues = await CallMapperAndReturnAsync <GitlabProject, List <GitlabIssue> >(currentProjectVo,
                                                                                                            project => _projectContentOrchestrator.GetGitlabIssues(project));

            List <GitlabIssueVO> gitlabIssueVos = issues.Select(gitlabIssue =>
                                                                Mapper.Mapper.Map <GitlabIssueVO>(gitlabIssue))
                                                  .ToList();

            gitlabIssueVos = gitlabIssueVos.OrderBy(i => (int)i.StepType).ToList();

            Application.Current.Dispatcher?.Invoke(() =>
            {
                bool previousIsRefreshing = IsRefreshing;
                IsRefreshing = true;
                if (!refresh)
                {
                    GitlabIssues.Clear();
                }

                foreach (GitlabIssueVO gitlabIssueVo in gitlabIssueVos)
                {
                    gitlabIssueVo.CurrentProject = currentProjectVo;
                    GitlabIssues.Add(gitlabIssueVo);
                }

                IsRefreshing = previousIsRefreshing;

                if (refresh)
                {
                    GroupedIssues.Refresh();
                    GroupedIssues.GroupDescriptions.Clear();
                }
            });
        }
Exemplo n.º 3
0
        private async Task LaunchPgm()
        {
            if (PgmSettingVo == null && SelectedProject == null)
            {
                PGMSetting setting = _pgmService.InitializePgm();

                PgmSettingVo    = Mapper.Mapper.Map <PGMSettingVO>(setting);
                SelectedProject = new ProjectVO();

                if (!setting.PgmHasSetup && _setupSettingsDialog == null)
                {
                    _setupSettingsDialog = await _dialogCoordinatorService.ShowConfigSettings("SetupSettingsDialog");
                }
                else
                {
                    IEnumerable <GitlabProject> projects = await _mainOrchestrator.GetGitlabProjectsFromCurrentUser();

                    CallMapper <List <ProjectVO> >(projects, projectsVo =>
                                                   projectsVo.ForEach(projectVo => ProjectsVo.Add(projectVo)));
                }
            }
        }
Exemplo n.º 4
0
 private void DeleteCurrentProject(ProjectVO projectVo)
 {
     PgmSettingVo.Projects.Remove(projectVo);
     CallMapper <PGMSetting>(PgmSettingVo, pgmSetting => _pgmService.WriteOnPgmSettings(pgmSetting));
 }
Exemplo n.º 5
0
 private bool CanDeleteCurrentProject(ProjectVO projectVo)
 {
     return(true);
 }