bool FindSection (List<string> lines, string name, bool preProject, out int start, out int end)
{
start = -1;
end = -1;
string prePost = preProject ? "preProject" : "postProject";
var sectionLine = "ProjectSection(" + name + ")=" + prePost;
for (int n=0; n<lines.Count && start == -1; n++) {
string line = lines [n].Replace ("\t","").Replace (" ", "");
if (line == sectionLine)
start = n;
}
if (start == -1)
return false;
for (int n=start+1; n<lines.Count && end == -1; n++) {
string line = lines [n].Replace ("\t","").Replace (" ", "");
if (line == "EndProjectSection")
end = n;
}
return end != -1;
}