public static SourceFile AugmentProject(Project project, string filepath, string filecontents) { var file = new SourceFile(); file.FileFullPath = filepath; file.AugmentProject(project, filecontents); return(file); }
// // Issue a request to parse the project. Automatically // early-outs if parsing has occurred recently to help // avoid slamming the main thread with redundant work. // public void ParseIfOutdated() { if (DateTime.Now < LastParseTime.AddSeconds(15.0)) { return; } LastParseTime = DateTime.Now; ResetContents(); var filenames = new HashSet <string>(); ParseHierarchy(Hierarchy, (uint)VSConstants.VSITEMID.Root, filenames); foreach (var filename in filenames) { string text = System.IO.File.ReadAllText(filename); SourceFile.AugmentProject(this, filename, text); } }
private void ParseFile(string filename) { string text = System.IO.File.ReadAllText(filename); var file = SourceFile.AugmentProject(this, filename, text); }