MonoDevelop.Projects.Formats.MSBuild.SlnFileFormat.FindSection C# (CSharp) Method

FindSection() private method

private FindSection ( List lines, string name, bool preProject, int &start, int &end ) : bool
lines List
name string
preProject bool
start int
end int
return bool
		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;
		}