private void projectManager_SolutionClosing(object sender, SolutionEventArgs e) { if (this.solution != null) { ((Microsoft.Expression.Extensibility.Project.Solution) this.solution).Close(); this.solution = null; } this.projectManager.SolutionClosing -= new EventHandler <SolutionEventArgs>(this.projectManager_SolutionClosing); this.projectManager.ProjectClosing -= new EventHandler <ProjectEventArgs>(this.projectManager_ProjectClosing); }
private Microsoft.Expression.Extensibility.Project.ISolution MakeSolutionForExtension() { ISolutionManagement currentSolution = this.projectManager.CurrentSolution as ISolutionManagement; if (currentSolution != null) { this.solution = new Microsoft.Expression.Extensibility.Project.Solution(currentSolution, this.projectManager); this.projectManager.SolutionClosing += new EventHandler <SolutionEventArgs>(this.projectManager_SolutionClosing); this.projectManager.ProjectClosing += new EventHandler <ProjectEventArgs>(this.projectManager_ProjectClosing); } return(this.solution); }