Ejemplo n.º 1
0
        protected void OnStep(object sender, DebugInformation info)
        {
            if (Step != null)
            {
                Step(this, info);
            }

            if (Break != null)
            {
                BreakPoint breakpoint = BreakPoints.Find(l =>
                {
                    bool afterStart, beforeEnd;

                    if (l.Line == info.CurrentStatement.Source.Start.Line)
                    {
                        return(true);
                    }

                    afterStart = l.Line > info.CurrentStatement.Source.Start.Line ||
                                 (l.Line == info.CurrentStatement.Source.Start.Line && l.Char >= info.CurrentStatement.Source.Start.Char);

                    if (!afterStart)
                    {
                        return(false);
                    }

                    beforeEnd = l.Line < info.CurrentStatement.Source.Stop.Line ||
                                (l.Line == info.CurrentStatement.Source.Stop.Line && l.Char <= info.CurrentStatement.Source.Stop.Char);

                    if (!beforeEnd)
                    {
                        return(false);
                    }

                    if (!String.IsNullOrEmpty(l.Condition))
                    {
                        return(Convert.ToBoolean(this.Run(l.Condition)));
                    }

                    return(true);
                });


                if (breakpoint != null)
                {
                    Break(this, info);
                }
            }
        }
Ejemplo n.º 2
0
 private void RemoveBreakPoint(JToken bp) => BreakPoints.Remove(BreakPoints.Find(bp.ToObject <string>()));