/// <inheritdoc />
        public void ProjectFinishedGenerating(EnvDTE.Project project)
        {
            var projectNode = project.Object as SandcastleBuilderProjectNode;

            if (projectNode == null || projectNode.SandcastleProject == null)
            {
                Utility.ShowMessageBox(OLEMSGICON.OLEMSGICON_CRITICAL,
                                       "Unable to object new project reference.  The import cannot be performed.");
                return;
            }

            using (NewFromOtherFormatDlg dlg = new NewFromOtherFormatDlg(projectNode.SandcastleProject))
            {
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    Utility.ShowMessageBox(OLEMSGICON.OLEMSGICON_INFO, "The project was converted " +
                                           "successfully.  When prompted, reload the project to see the conversion's changes.");
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Create a new project from a project file that is in a different format (i.e. SHFB 1.7.0.0 or earlier
        /// or NDoc 1.x)
        /// </summary>
        /// <param name="sender">The sender of the event</param>
        /// <param name="e">The event arguments</param>
        private void miNewFromOtherFormat_Click(object sender, EventArgs e)
        {
            if(this.CloseProject())
                using(NewFromOtherFormatDlg dlg = new NewFromOtherFormatDlg())
                {
                    if(dlg.ShowDialog() == DialogResult.OK)
                    {
                        try
                        {
                            this.Cursor = Cursors.WaitCursor;
                            this.CreateProject(dlg.NewProjectFilename, true);
                            this.UpdateFilenameInfo();
                            MainForm.UpdateMruList(project.Filename);

                            MessageBox.Show("The project was converted successfully", Constants.AppName,
                                MessageBoxButtons.OK, MessageBoxIcon.Information);
                        }
                        catch(Exception ex)
                        {
                            System.Diagnostics.Debug.Write(ex);
                            MessageBox.Show(ex.Message, Constants.AppName, MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                        }
                        finally
                        {
                            this.Cursor = Cursors.Default;
                            projectProperties.RefreshProperties();
                        }
                    }
                }
        }