/// <summary> /// Starts tracing of the method from which this method is called /// </summary> public void StartTrace() { MethodTraceResult method = new MethodTraceResult(); ThreadTraceResult thread = new ThreadTraceResult(); threadStacks.TryAdd(thread.ID, new Stack <MethodTraceResult>()); threadStacks[thread.ID].Push(method); method.StartStopwatch(); }
private void Method(int idTheard, string MethodName, string ClassName) { List <MethodTraceResult> ListMethod = new List <MethodTraceResult>(); ListMethod = TraceInfo.Theards[idTheard].Methods; for (int i = 1; i < MethodStack[idTheard]; i++) { ListMethod = ListMethod[ListMethod.Count - 1].Methods; } MethodTraceResult InfoMethod = new MethodTraceResult(); InfoMethod.MethodName = MethodName; InfoMethod.MethodClassName = ClassName; ListMethod.Add(InfoMethod); }
private void CopyMethodsList(List <MethodTraceResult> destList, List <MethodTraceResultClass> sourceList) { foreach (MethodTraceResultClass mtrc in sourceList) { MethodTraceResult newMtr = new MethodTraceResult(); newMtr.methodName = mtrc.methodName; newMtr.className = mtrc.className; newMtr.threadId = mtrc.threadId; newMtr.execTime = mtrc.execTime; newMtr.calledMethods = new List <MethodTraceResult>(); if (mtrc.calledMethods.Count > 0) { CopyMethodsList(newMtr.calledMethods, mtrc.calledMethods); } destList.Add(newMtr); } }
//Adds nested method to Methods list internal void AddMethod(MethodTraceResult method) => Methods.Add(method);
public void AddMethod(MethodTraceResult method) => Methods.Add(method);