Пример #1
0
        public static void VerifyBreakpointRemovedOne(List <BreakpointModel> breakpoints)
        {
            if (CurrentSession == null)
            {
                return;
            }

            List <BreakpointModel> newBreakpointsList = currentBreakpointsList.Where(n => !breakpoints.Any(o => o.Name == n.Name)).ToList();

            foreach (BreakpointModel item in newBreakpointsList)
            {
                currentBreakpointsList.Remove(item);

                IEventData eventData = new EventData
                {
                    EventKind       = EventKind.BreakpointRemove.ToString(),
                    Detail          = item.Name,
                    Namespace       = PathNodeModel.GeNamespaceName(item.FunctionName),
                    Type            = PathNodeModel.GeTypeName(item.FunctionName),
                    TypeFullPath    = "TODO",
                    Method          = PathNodeModel.GetMethodName(item.FunctionName),
                    MethodKey       = String.Empty,
                    MethodSignature = item.FunctionName,
                    CharStart       = item.StartLineText,
                    CharEnd         = item.DocumentModel.EndLineText,
                    LineNumber      = item.DocumentModel.CurrentLineNumber,
                    LineOfCode      = item.DocumentModel.CurrentLine,
                    Created         = DateTime.Now
                };

                CurrentSession.Events.Add(eventData);
                Repository.Save(CurrentSession);
            }
        }
Пример #2
0
        public static void RegisterAlreadyAddedBreakpoints(List <BreakpointModel> breakpoints)
        {
            if (addedBreakpoints)
            {
                return;
            }

            foreach (BreakpointModel item in breakpoints)
            {
                currentBreakpointsList.Add(item);
                dataBreakpointsList.Add(item);

                IEventData eventData = new EventData
                {
                    EventKind       = EventKind.BreakpointAdd.ToString(),
                    Detail          = item.Name,
                    Namespace       = PathNodeModel.GeNamespaceName(item.FunctionName),
                    Type            = PathNodeModel.GeTypeName(item.FunctionName),
                    TypeFullPath    = "TODO",
                    Method          = PathNodeModel.GetMethodName(item.FunctionName),
                    MethodKey       = String.Empty,
                    MethodSignature = item.FunctionName,
                    CharStart       = item.StartLineText,
                    CharEnd         = item.DocumentModel.EndLineText,
                    LineNumber      = item.DocumentModel.CurrentLineNumber,
                    LineOfCode      = item.DocumentModel.CurrentLine,
                    Created         = DateTime.Now
                };

                BreakpointData breakpointData = new BreakpointData
                {
                    BreakpointKind = BreakpointKind.Line.ToString(),
                    Namespace      = PathNodeModel.GeNamespaceName(item.FunctionName),
                    Type           = PathNodeModel.GeTypeName(item.FunctionName),
                    LineNumber     = item.FileLine,
                    LineOfCode     = item.DocumentModel.CurrentLine,
                    Origin         = BreakpointOrigin.AddedBeforeDebug.ToString(),
                    Created        = DateTime.Now
                };

                CurrentSession.Events.Add(eventData);
                CurrentSession.Breakpoints.Add(breakpointData);
                Repository.Save(CurrentSession);

                addedBreakpoints = true;
            }
        }
Пример #3
0
        private static void AddNodeAsOf(int start, List <string> stackTrace, PathNodeOrigin pathNodeOrigin)
        {
            for (int i = start; i < stackTrace.Count; i++)
            {
                CurrentSession.PathNodes.Add(new PathNodeData
                {
                    Method    = PathNodeModel.GetMethodName(stackTrace[i]),
                    Created   = DateTime.Now,
                    Namespace = PathNodeModel.GeNamespaceName(stackTrace[i]),
                    Parent    = i == 0 ? null : PathNodeModel.GetMethodName(stackTrace[i - 1]),
                    Type      = PathNodeModel.GeTypeName(stackTrace[i]),
                    Origin    = i == stackTrace.Count - 1 ? pathNodeOrigin.ToString() : PathNodeOrigin.Trace.ToString()
                });

                Repository.Save(CurrentSession);
            }
        }
Пример #4
0
        public static void RegisterStep(StepModel sessionModel)
        {
            IEventData eventData = new EventData
            {
                EventKind       = ((EventKind)sessionModel.CurrentCommandStep).ToString(),
                Detail          = "TODO",
                Namespace       = PathNodeModel.GeNamespaceName(sessionModel.CurrentStackFrameFunctionName),
                Type            = PathNodeModel.GeTypeName(sessionModel.CurrentStackFrameFunctionName),
                TypeFullPath    = "TODO",
                Method          = PathNodeModel.GetMethodName(sessionModel.CurrentStackFrameFunctionName),
                MethodKey       = String.Empty,
                MethodSignature = sessionModel.CurrentStackFrameFunctionName,
                CharStart       = sessionModel.CurrentDocument.StartLineText,
                CharEnd         = sessionModel.CurrentDocument.EndLineText,
                LineNumber      = sessionModel.CurrentDocument.CurrentLineNumber,
                LineOfCode      = sessionModel.CurrentDocument.CurrentLine,
                Created         = DateTime.Now
            };

            CurrentSession.Events.Add(eventData);
            Repository.Save(CurrentSession);
        }