本文整理匯總了C#中Chunk.ToInt32方法的典型用法代碼示例。如果您正苦於以下問題:C# Chunk.ToInt32方法的具體用法?C# Chunk.ToInt32怎麽用?C# Chunk.ToInt32使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Chunk
的用法示例。
在下文中一共展示了Chunk.ToInt32方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
}
}
示例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);
;
}
示例3: 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);
}
示例4: 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);
}