public void OnRemoveBuildProcessTemplate()
        {
            try
            {
                var items     = this.view.SelectedBuildProcessTemplates.ToList();
                var projects  = this.repository.AllTeamProjects.Select(tp => tp.Name).ToList();
                var viewModel = new TeamProjectListViewModel(projects);

                var wnd = new SelectTeamProject(viewModel, this.view.SelectedTeamProject)
                {
                    cbSetAsDefault = { Visibility = Visibility.Collapsed }
                };
                bool?res = wnd.ShowDialog();
                if (res.HasValue && res.Value)
                {
                    using (new WaitCursor())
                    {
                        this.repository.RemoveBuildProcessTemplates(items.Select(pt => pt.ServerPath), wnd.SelectedTeamProjects.Select(tp => tp.Name), this.ShouldRemove);
                        this.OnRefresh(new EventArgs());
                    }

                    this.OnRefresh(new EventArgs());
                }
            }
            catch (Exception ex)
            {
                this.view.DisplayError(ex);
            }
        }
Exemplo n.º 2
0
        public SelectTeamProject(TeamProjectListViewModel model, string selectedTeamProject)
        {
            this.model = model;
            this.InitializeComponent();

            this.Grid1.DataContext = this.model;
            if (selectedTeamProject != null)
            {
                var project = model.TeamProjects.FirstOrDefault(tp => tp.Name == selectedTeamProject);
                if (project != null)
                {
                    this.BuildControllerList.SelectedValue = project;
                }
            }
        }