Browse Source

Fixed bug that caused the ParserService to "forget" parsing the projects when a solution was opened with a command line argument.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@416 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 21 years ago
parent
commit
b28e1079c2
  1. 5
      src/Main/Base/Project/Src/Services/ParserService/ParserService.cs
  2. 11
      src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs

5
src/Main/Base/Project/Src/Services/ParserService/ParserService.cs

@ -68,7 +68,6 @@ namespace ICSharpCode.Core
{ {
parser = (ParserDescriptor[])AddInTree.BuildItems("/Workspace/Parser", null, false).ToArray(typeof(ParserDescriptor)); parser = (ParserDescriptor[])AddInTree.BuildItems("/Workspace/Parser", null, false).ToArray(typeof(ParserDescriptor));
ProjectService.SolutionLoaded += OpenCombine;
ProjectService.SolutionClosed += ProjectServiceSolutionClosed; ProjectService.SolutionClosed += ProjectServiceSolutionClosed;
} }
@ -86,7 +85,9 @@ namespace ICSharpCode.Core
static Thread loadSolutionProjectsThread; static Thread loadSolutionProjectsThread;
static bool abortLoadSolutionProjectsThread; static bool abortLoadSolutionProjectsThread;
static void OpenCombine(object sender, SolutionEventArgs e) // do not use an event for this because a solution might be loaded fore ParserService
// is initialized
internal static void OnSolutionLoaded()
{ {
if (loadSolutionProjectsThread != null) { if (loadSolutionProjectsThread != null) {
if (!abortLoadSolutionProjectsThread) if (!abortLoadSolutionProjectsThread)

11
src/Main/Base/Project/Src/Services/ProjectService/ProjectService.cs

@ -187,8 +187,17 @@ namespace ICSharpCode.SharpDevelop.Project
OnProjectItemRemoved(new ProjectItemEventArgs(project, item)); OnProjectItemRemoved(new ProjectItemEventArgs(project, item));
} }
static void BeforeLoadSolution()
{
if (openSolution != null) {
SaveSolutionPreferences();
CloseSolution();
}
}
public static void LoadSolution(string fileName) public static void LoadSolution(string fileName)
{ {
BeforeLoadSolution();
openSolution = Solution.Load(fileName); openSolution = Solution.Load(fileName);
if (openSolution == null) if (openSolution == null)
return; return;
@ -214,6 +223,7 @@ namespace ICSharpCode.SharpDevelop.Project
/// </summary> /// </summary>
public static void LoadProject(string fileName) public static void LoadProject(string fileName)
{ {
BeforeLoadSolution();
string solutionFile = Path.ChangeExtension(fileName, ".sln"); string solutionFile = Path.ChangeExtension(fileName, ".sln");
if (File.Exists(solutionFile)) { if (File.Exists(solutionFile)) {
LoadSolution(solutionFile); LoadSolution(solutionFile);
@ -339,6 +349,7 @@ namespace ICSharpCode.SharpDevelop.Project
static void OnSolutionLoaded(SolutionEventArgs e) static void OnSolutionLoaded(SolutionEventArgs e)
{ {
ParserService.OnSolutionLoaded();
if (SolutionLoaded != null) { if (SolutionLoaded != null) {
SolutionLoaded(null, e); SolutionLoaded(null, e);
} }

Loading…
Cancel
Save