Esempio n. 1
0
        public override void Execute(IButtonCommandContext context)
        {
            //First selected project
            foreach (Project project in (Array)Application.ActiveSolutionProjects)
            {
                FileInfo currentPom = context.CurrentSelectedProjectPom;
                if (currentPom == null || Path.GetDirectoryName(currentPom.FullName) != Path.GetDirectoryName(project.FullName))
                {
                    DialogResult result = MessageBox.Show("Pom file not found, do you want to import the projects first before adding Maven Artifact?", "Add Maven Artifact", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                    if (result == DialogResult.Cancel)
                        return;

                    if (result == DialogResult.OK)
                    {
                        context.ExecuteCommand<ImportSelectedProjectCommand>(); ;

                        currentPom = context.CurrentSelectedProjectPom;

                        // if import failed
                        if (currentPom == null || Path.GetDirectoryName(currentPom.FullName) != Path.GetDirectoryName(project.FullName))
                        {
                            return;
                        }
                    }
                }

                AddArtifactsForm form = new AddArtifactsForm(project, context.ArtifactContext, currentPom);
                form.Show();
                break;
            }
        }
Esempio n. 2
0
        public override void Execute(IButtonCommandContext context)
        {
            //First selected project
            foreach (Project project in (Array)Application.ActiveSolutionProjects)
            {
                FileInfo currentPom = context.CurrentSelectedProjectPom;
                if (currentPom == null || Path.GetDirectoryName(currentPom.FullName) != Path.GetDirectoryName(project.FullName))
                {
                    DialogResult result = MessageBox.Show("Pom file not found, do you want to import the projects first before adding Maven Artifact?", "Add Maven Artifact", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                    if (result == DialogResult.Cancel)
                    {
                        return;
                    }

                    if (result == DialogResult.OK)
                    {
                        context.ExecuteCommand <ImportSelectedProjectCommand>();;

                        currentPom = context.CurrentSelectedProjectPom;

                        // if import failed
                        if (currentPom == null || Path.GetDirectoryName(currentPom.FullName) != Path.GetDirectoryName(project.FullName))
                        {
                            return;
                        }
                    }
                }

                AddArtifactsForm form = new AddArtifactsForm(project, context.ArtifactContext, context.Logger, currentPom);
                form.Show();
                break;
            }
        }
        public override void Execute(IButtonCommandContext context)
        {
            context.ExecuteCommand("File.SaveAll");

            NPandayImportProjectForm frm = new NPandayImportProjectForm(Application);
            frm.ShowDialog();
        }
Esempio n. 4
0
        public override void Execute(IButtonCommandContext context)
        {
            context.ExecuteCommand("File.SaveAll");

            NPandayImportProjectForm frm = new NPandayImportProjectForm(Application, context.Logger);

            frm.ShowDialog();
        }