public void AddSubframes(string[] lines, QueryPerformed query) { if (!lines[0].Equals(CurrentFrame)) { throw new Exception("Current frame did not match expected lines[0]"); } QueryCount += query.TimesSeen; //we are the last line if (lines.Length == 1) { return; } //we know about the child if (Children.ContainsKey(lines[1])) { Children[lines[1]].AddSubframes(lines.Skip(1).ToArray(), query);//tell child to audit the relevant subframes } else { Children.Add(lines[1], new StackFramesTree(lines.Skip(1).ToArray(), query, IsInDatabaseAccessAssembly)); } }
public StackFramesTree(string[] stackFrameAndSubframes, QueryPerformed performed, bool isInDatabaseAccessAssemblyYet) { QueryCount = 0; PopulateSourceCode(stackFrameAndSubframes[0]); CurrentFrame = stackFrameAndSubframes[0]; AddSubframes(stackFrameAndSubframes, performed); IsInDatabaseAccessAssembly = isInDatabaseAccessAssemblyYet || CurrentFrame.Contains("MapsDirectlyToDatabaseTable") || CurrentFrame.Contains("DatabaseCommandHelper"); }