Browse Source

Fixed SD2-886: Converted VS2003 solution does not show correct configurations

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.0@1522 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
63e20cbdbe
  1. 2
      src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG
  2. 56
      src/Main/Base/Project/Src/Project/Solution/Solution.cs

2
src/Libraries/NRefactory/Project/Src/Parser/CSharp/cs.ATG

@ -1886,7 +1886,7 @@ EmbeddedStatement<out Statement statement> @@ -1886,7 +1886,7 @@ EmbeddedStatement<out Statement statement>
(statement as IfElseStatement).ElseIfSections.AddRange((elseStatement as IfElseStatement).ElseIfSections);
(statement as IfElseStatement).FalseStatement = (elseStatement as IfElseStatement).FalseStatement;
} .)
| "switch" (. List<SwitchSection> switchSections = new List<SwitchSection>(); SwitchSection switchSection; .)
| "switch" (. List<SwitchSection> switchSections = new List<SwitchSection>(); .)
"(" Expr<out expr> ")"
"{" SwitchSections<switchSections>
"}" (. statement = new SwitchStatement(expr, switchSections); .)

56
src/Main/Base/Project/Src/Project/Solution/Solution.cs

@ -496,12 +496,21 @@ namespace ICSharpCode.SharpDevelop.Project @@ -496,12 +496,21 @@ namespace ICSharpCode.SharpDevelop.Project
public ProjectSection GetSolutionConfigurationsSection()
{
foreach (ProjectSection sec in Sections) {
foreach (ProjectSection sec in this.Sections) {
if (sec.Name == "SolutionConfigurationPlatforms")
return sec;
}
ProjectSection newSec = new ProjectSection("SolutionConfigurationPlatforms", "preSolution");
Sections.Insert(0, newSec);
this.Sections.Insert(0, newSec);
foreach (ProjectSection sec in this.Sections) {
if (sec.Name == "SolutionConfiguration") {
this.Sections.Remove(sec);
foreach (SolutionItem item in sec.Items) {
newSec.Items.Add(new SolutionItem(item.Name + "|Any CPU", item.Location + "|Any CPU"));
}
break;
}
}
return newSec;
}
@ -513,6 +522,49 @@ namespace ICSharpCode.SharpDevelop.Project @@ -513,6 +522,49 @@ namespace ICSharpCode.SharpDevelop.Project
}
ProjectSection newSec = new ProjectSection("ProjectConfigurationPlatforms", "postSolution");
Sections.Add(newSec);
foreach (ProjectSection sec in this.Sections) {
if (sec.Name == "ProjectConfiguration") {
this.Sections.Remove(sec);
foreach (SolutionItem item in sec.Items) {
string name = item.Name;
string location = item.Location;
if (!name.Contains("|")) {
int pos = name.LastIndexOf('.');
if (pos > 0) {
string firstpart = name.Substring(0, pos);
string lastpart = name.Substring(pos);
if (lastpart == ".0") {
pos = firstpart.LastIndexOf('.');
if (pos > 0) {
lastpart = name.Substring(pos);
firstpart = name.Substring(0, pos);
}
}
name = firstpart + "|Any CPU" + lastpart;
}
pos = location.LastIndexOf('|');
if (pos < 0) {
location += "|Any CPU";
} else {
string platform = location.Substring(pos+1);
bool found = false;
foreach (IProject p in this.Projects) {
if (p.GetPlatformNames().Contains(platform)) {
found = true;
break;
}
}
if (!found) {
location = location.Substring(0, pos) + "|Any CPU";
}
}
}
newSec.Items.Add(new SolutionItem(name, location));
}
break;
}
}
return newSec;
}

Loading…
Cancel
Save