/// <summary>
        /// Associates the with new project.
        /// </summary>
        /// <param name="configIn">The configuration in.</param>
        /// <param name="project">The project.</param>
        /// <param name="workingDir">The working dir.</param>
        /// <param name="provider">The provider.</param>
        /// <param name="sourcePlugin">The source plugin.</param>
        public void AssociateWithNewProject(ISonarConfiguration configIn, Resource project, string workingDir, ISourceControlProvider provider, IIssueTrackerPlugin sourcePlugin)
        {
            this.sourceDir         = workingDir;
            this.associatedProject = project;
            this.config            = configIn;

            if (this.CommandText.Equals("Add to Existent Plan"))
            {
                Application.Current.Dispatcher.Invoke(
                    delegate
                {
                    this.SubItems.Clear();

                    foreach (var item in this.rest.GetAvailableActionPlan(this.config, project.Key))
                    {
                        var menu = new PlanMenu(this.rest, this.model, this.manager, false)
                        {
                            CommandText = item.Name, IsEnabled = true
                        };
                        menu.AssociateWithNewProject(configIn, project, workingDir, provider, sourcePlugin);
                        this.SubItems.Add(menu);
                    }
                });
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Reloads the plan data.
        /// </summary>
        /// <param name="parentMenu">The parent menu.</param>
        private void ReloadPlanData(PlanMenu parentMenu)
        {
            foreach (var item in parentMenu.SubItems)
            {
                if (item.CommandText.Equals("Add to Existent Plan"))
                {
                    Application.Current.Dispatcher.Invoke(
                        delegate
                    {
                        item.SubItems.Clear();

                        foreach (var plan in this.rest.GetAvailableActionPlan(this.config, this.associatedProject.Key))
                        {
                            var menu = new PlanMenu(this.rest, this.model, this.manager, null, false)
                            {
                                CommandText = plan.Name, IsEnabled = true
                            };
                            menu.AssociateWithNewProject(this.config, this.associatedProject, this.sourceDir, this.provider, this.sourcePlugin);
                            item.SubItems.Add(menu);
                        }
                    });
                }
            }
        }
        /// <summary>
        /// Associates the with new project.
        /// </summary>
        /// <param name="configIn">The configuration in.</param>
        /// <param name="project">The project.</param>
        /// <param name="workingDir">The working dir.</param>
        /// <param name="provider">The provider.</param>
        /// <param name="sourcePlugin">The source plugin.</param>
        public void AssociateWithNewProject(ISonarConfiguration configIn, Resource project, string workingDir, ISourceControlProvider provider, IIssueTrackerPlugin sourcePlugin)
        {
            this.sourceDir = workingDir;
            this.associatedProject = project;
            this.config = configIn;

            if (this.CommandText.Equals("Add to Existent Plan"))
            {
                Application.Current.Dispatcher.Invoke(
                    delegate
                    {
                        this.SubItems.Clear();

                        foreach (var item in this.rest.GetAvailableActionPlan(this.config, project.Key))
                        {
                            var menu = new PlanMenu(this.rest, this.model, this.manager, false) { CommandText = item.Name, IsEnabled = true };
                            menu.AssociateWithNewProject(configIn, project, workingDir, provider, sourcePlugin);
                            this.SubItems.Add(menu);
                        }
                    });
            }
        }
        /// <summary>
        /// Reloads the plan data.
        /// </summary>
        /// <param name="parentMenu">The parent menu.</param>
        private void ReloadPlanData(PlanMenu parentMenu)
        {
            foreach (var item in parentMenu.SubItems)
            {
                if (item.CommandText.Equals("Add to Existent Plan"))
                {
                    Application.Current.Dispatcher.Invoke(
                        delegate
                        {
                            item.SubItems.Clear();

                            foreach (var plan in this.rest.GetAvailableActionPlan(this.config, this.associatedProject.Key))
                            {
                                var menu = new PlanMenu(this.rest, this.model, this.manager, null, false) { CommandText = plan.Name, IsEnabled = true };
                                menu.AssociateWithNewProject(this.config, this.associatedProject, this.sourceDir, this.provider, this.sourcePlugin);
                                item.SubItems.Add(menu);
                            }
                        });
                }
            }
        }