/// <summary> /// Runs custom wizard logic when a project has finished generating. /// </summary> /// <param name="project">The project that finished generating.</param> public void ProjectFinishedGenerating(EnvDTE.Project project) { var factory = serviceHost.GetService<IVsPackageManagerFactory>(); var manager = factory.CreatePackageManager(); var package = manager.SourceRepository.FindPackage("UmbracoCms"); manager.InstallPackage( new List<Project>() { project }, package, new List<PackageOperation> { new PackageOperation(package, PackageAction.Install) }, false, false, NuGet.NullLogger.Instance, null); try { var csProj = project.FileName; // Display a form to the user. The form collects // input for the custom message. inputForm = new UserInputForm(); //Set a value on inputForm inputForm.CSProjPath = csProj; //Show the form inputForm.ShowDialog(); //Fetch value from input form dbConnectionString = inputForm.get_dbConnectionString(); dbType = inputForm.get_dbType(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }
/// <summary> /// Runs custom wizard logic when a project has finished generating. /// </summary> /// <param name="project">The project that finished generating.</param> public void ProjectFinishedGenerating(EnvDTE.Project project) { var factory = serviceHost.GetService <IVsPackageManagerFactory>(); var manager = factory.CreatePackageManager(); var package = manager.SourceRepository.FindPackage("UmbracoCms"); manager.InstallPackage( new List <Project>() { project }, package, new List <PackageOperation> { new PackageOperation(package, PackageAction.Install) }, false, false, NuGet.NullLogger.Instance, null); try { var csProj = project.FileName; // Display a form to the user. The form collects // input for the custom message. inputForm = new UserInputForm(); //Set a value on inputForm inputForm.CSProjPath = csProj; //Show the form inputForm.ShowDialog(); //Fetch value from input form dbConnectionString = inputForm.get_dbConnectionString(); dbType = inputForm.get_dbType(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } }