public void SetSrcFileRootPath(string srcRoot) { m_sourceCache = new SourceCache(srcRoot); }
public RootItem ComputeHashCode(string srcRootPath) { m_sourceCache = new SourceCache(srcRootPath); List<string> lines; StringBuilder sb; string result; foreach (ClassItem classItem in m_classMap.Values) { lines = m_sourceCache.GetSource(classItem.Descriptor.SrcFileName); sb = new StringBuilder(); for (int l = classItem.FirstLine; l <=classItem.LastLine; l++) { sb.Append(lines[l]); } classItem.HashCode = sb.ToString().GetHashCode(); for (int i = 0; i < classItem.Descriptor.Methods.Length; i++) { MethodDescriptor method = classItem.Descriptor.Methods[i]; sb = new StringBuilder(); for (int j = method.FirstLine; j <= method.LastLine; j++) { sb.Append(lines[j]); } result = sb.ToString(); ((MethodItem)classItem.Children[i]).HashCode = result.GetHashCode(); foreach (Item child in classItem.Children[i].Children) { BlockItem block = child as BlockItem; sb = new StringBuilder(); for (int k = 0; k < block.Lines.Length; k++) { sb.Append(lines[block.Lines[k]]); } result = sb.ToString(); block.HashCode = result.GetHashCode(); } } } return m_view; }