Example #1
0
            }             // proc UpdateStackLine

            private void UpdateStack(LuaTraceLineEventArgs e)
            {
                var stack = frames.ToArray();

                var currentLeft = Console.CursorLeft;
                var currentTop  = Console.CursorTop;
                var top         = 0;

                try
                {
                    var start = stack.Length > 9
                                                ? stack.Length - 8
                                                : 0;

                    for (var i = start; i < stack.Length; i++)
                    {
                        UpdateStackLine(top++, stack[i]);
                    }
                    UpdateStackLine(top++, e);

                    while (top < 9)
                    {
                        UpdateStackLine(top++, null);
                    }
                }
                finally
                {
                    Console.CursorLeft = currentLeft;
                    Console.CursorTop  = currentTop;
                }
                Thread.Sleep(100);
            }             // proc UpdateStack
Example #2
0
            private void UpdateStackLine(int iTop, LuaTraceLineEventArgs e)
            {
                // 12345678.123 123
                Console.CursorLeft = Console.WindowWidth - 16;
                Console.CursorTop  = iTop;
                if (e == null)
                {
                    Console.Write(new string(' ', 16));
                }
                else
                {
                    string sFileName = Path.GetFileName(e.SourceName);
                    if (sFileName.Length > 12)
                    {
                        sFileName = sFileName.Substring(0, 12);
                    }
                    else if (sFileName.Length < 12)
                    {
                        sFileName = sFileName.PadRight(12);
                    }

                    string sLine = e.SourceLine.ToString().PadLeft(4);
                    if (sLine.Length > 4)
                    {
                        sLine = sLine.Substring(0, 4);
                    }

                    WriteText(ConsoleColor.DarkGray, sFileName);
                    WriteText(ConsoleColor.Gray, sLine);
                }
            } // proc UpdateStackLine
Example #3
0
            } // proc OnExceptionUnwind

            protected override void OnFrameEnter(LuaTraceLineEventArgs e)
            {
                base.OnFrameEnter(e);
                if (lastTracePoint != null)
                {
                    frames.Push(lastTracePoint);
                }
            } // proc OnFrameEnter
Example #4
0
            } // proc UpdateStackLine

            private void UpdateStack(LuaTraceLineEventArgs e)
            {
                var stack = frames.ToArray();

                int iCurrentLeft = Console.CursorLeft;
                int iCurrentTop  = Console.CursorTop;
                int iStart;
                int iTop = 0;

                try
                {
                    if (stack.Length > 9)
                    {
                        iStart = stack.Length - 8;
                    }
                    else
                    {
                        iStart = 0;
                    }

                    for (int i = iStart; i < stack.Length; i++)
                    {
                        UpdateStackLine(iTop++, stack[i]);
                    }
                    UpdateStackLine(iTop++, e);

                    while (iTop < 9)
                    {
                        UpdateStackLine(iTop++, null);
                    }
                }
                finally
                {
                    Console.CursorLeft = iCurrentLeft;
                    Console.CursorTop  = iCurrentTop;
                }
                Thread.Sleep(100);
            } // proc UpdateStack
Example #5
0
            } // proc OnFrameEnter

            protected override void OnTracePoint(LuaTraceLineEventArgs e)
            {
                UpdateStack(lastTracePoint = e);
                base.OnTracePoint(e);
            } // proc OnTracePoint
Example #6
0
        }         // proc OnFrameEnter

        /// <summary></summary>
        /// <param name="e"></param>
        protected virtual void OnTracePoint(LuaTraceLineEventArgs e)
        {
        }         // proc OnTracePoint
Example #7
0
 /// <summary></summary>
 /// <param name="e"></param>
 protected virtual void OnFrameEnter(LuaTraceLineEventArgs e)
 {
 }         // proc OnFrameEnter