コード例 #1
0
ファイル: Tracer.cs プロジェクト: MaxKudravcev/CPP_Tracer
        /// <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();
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
 //Adds nested method to Methods list
 internal void AddMethod(MethodTraceResult method) => Methods.Add(method);
コード例 #5
0
 public void AddMethod(MethodTraceResult method) => Methods.Add(method);