Beispiel #1
0
        protected void OnStep(object sender, DebugInformation info)
        {
            if (Step != null)
            {
                Step(this, info);
            }

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

                    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);
                }
            }
        }