当前位置: 首页>>代码示例>>C#>>正文


C# Chunk.Advance方法代码示例

本文整理汇总了C#中Chunk.Advance方法的典型用法代码示例。如果您正苦于以下问题:C# Chunk.Advance方法的具体用法?C# Chunk.Advance怎么用?C# Chunk.Advance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Chunk的用法示例。


在下文中一共展示了Chunk.Advance方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StackFrame

        private StackFrame StackFrame(Chunk line)
        {
            line.Advance("  at ");
            var function = line.Advance(" in ").ToString();

            //exception message line format differences in .net and mono
            //On .net : at ConsoleApplication.Program.Main(String[] args) in D:\Program.cs:line 16
            //On Mono : at ConsoleApplication.Program.Main(String[] args) in d:\Program.cs:16
            var file = !IsMono ?
                line.Advance(":line ").ToString() :
                line.Advance(":").ToString();

            var lineNumber = line.ToInt32();

            if (string.IsNullOrEmpty(file))
            {
                return GetStackFrame(
                    // Handle stack trace lines like
                    // "--- End of stack trace from previous location where exception from thrown ---"
                    string.IsNullOrEmpty(function) ? line.ToString() : function,
                    file: string.Empty,
                    lineNumber: 0);
            }
            else
            {
                return GetStackFrame(function, file, lineNumber);
            }
        }
开发者ID:mike-kaufman,项目名称:Glimpse.Prototype,代码行数:28,代码来源:ExceptionProcessor.cs

示例2: StackFrame

        static Frame StackFrame(Chunk line)
        {
            line.Advance("  at ");
            var function = line.Advance(" in ").ToString();
            var file = line.Advance(":line ").ToString();
            var lineNumber = line.ToInt32();

            return string.IsNullOrEmpty(file)
                ? LoadFrame(line.ToString(), "", 0)
                : LoadFrame(function, file, lineNumber);
            ;
        }
开发者ID:bvanderveen,项目名称:gate,代码行数:12,代码来源:ShowExceptions.cs

示例3: StackFrames

        private IEnumerable<StackFrame> StackFrames(Exception ex)
        {
            var result = new List<StackFrame>();

            var stackTrace = ex.StackTrace;
            if (!string.IsNullOrEmpty(stackTrace))
            {
                var heap = new Chunk { Text = stackTrace + Environment.NewLine, End = stackTrace.Length + Environment.NewLine.Length };
                for (var line = heap.Advance(Environment.NewLine); line.HasValue; line = heap.Advance(Environment.NewLine))
                {
                    result.Add(StackFrame(line));
                }
            }

            return result;
        }
开发者ID:mike-kaufman,项目名称:Glimpse.Prototype,代码行数:16,代码来源:ExceptionProcessor.cs

示例4: StackFrames

 static IEnumerable<Frame> StackFrames(IEnumerable<string> stackTraces)
 {
     foreach (var stackTrace in stackTraces.Where(value => !string.IsNullOrWhiteSpace(value)))
     {
         var heap = new Chunk { Text = stackTrace + "\r\n", End = stackTrace.Length + 2 };
         for (var line = heap.Advance("\r\n"); line.HasValue; line = heap.Advance("\r\n"))
         {
             yield return StackFrame(line);
         }
     }
 }
开发者ID:majimenezp,项目名称:gate,代码行数:11,代码来源:ShowExceptions.cs

示例5: StackFrame

        private StackFrame StackFrame(Chunk line, bool showSource)
        {
            line.Advance("  at ");
            string function = line.Advance(" in ").ToString();
            string file = line.Advance(":line ").ToString();
            int lineNumber = line.ToInt32();

            return string.IsNullOrEmpty(file)
                ? LoadFrame(string.IsNullOrEmpty(function) ? line.ToString() : function, string.Empty, 0, showSource)
                : LoadFrame(function, file, lineNumber, showSource);
        }
开发者ID:Xamarui,项目名称:Katana,代码行数:11,代码来源:ErrorPageMiddleware.cs

示例6: StackFrames

 private IEnumerable<StackFrame> StackFrames(Exception ex, bool showSource)
 {
     var stackTrace = ex.StackTrace;
     if (!string.IsNullOrEmpty(stackTrace))
     {
         var heap = new Chunk { Text = stackTrace + Environment.NewLine, End = stackTrace.Length + Environment.NewLine.Length };
         for (Chunk line = heap.Advance(Environment.NewLine); line.HasValue; line = heap.Advance(Environment.NewLine))
         {
             yield return StackFrame(line, showSource);
         }
     }
 }
开发者ID:Xamarui,项目名称:Katana,代码行数:12,代码来源:ErrorPageMiddleware.cs

示例7: StackFrame

        private StackFrame StackFrame(Chunk line)
        {
            line.Advance("  at ");
            string function = line.Advance(" in ").ToString();

            //exception message line format differences in .net and mono
            //On .net : at ConsoleApplication.Program.Main(String[] args) in D:\Program.cs:line 16
            //On Mono : at ConsoleApplication.Program.Main(String[] args) in d:\Program.cs:16
            string file = !IsMono ?
                line.Advance(":line ").ToString() :
                line.Advance(":").ToString();

            int lineNumber = line.ToInt32();

            return string.IsNullOrEmpty(file)
                ? LoadFrame(string.IsNullOrEmpty(function) ? line.ToString() : function, string.Empty, 0)
                : LoadFrame(function, file, lineNumber);
        }
开发者ID:jgglg,项目名称:Diagnostics,代码行数:18,代码来源:ErrorPageMiddleware.cs


注:本文中的Chunk.Advance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。