Added new Stack Method
This commit is contained in:
parent
ab1cd8af42
commit
a9fed3b80d
@ -20,11 +20,19 @@ namespace Volian.Base.Library
|
|||||||
{
|
{
|
||||||
return StackToString();
|
return StackToString();
|
||||||
}
|
}
|
||||||
|
public static string GetStack(bool showSame)
|
||||||
|
{
|
||||||
|
return StackToString(showSame);
|
||||||
|
}
|
||||||
public static void ShowStack()
|
public static void ShowStack()
|
||||||
{
|
{
|
||||||
Console.WriteLine(StackToString());
|
Console.WriteLine(StackToString());
|
||||||
}
|
}
|
||||||
private static string StackToString()
|
private static string StackToString()
|
||||||
|
{
|
||||||
|
return StackToString(true);
|
||||||
|
}
|
||||||
|
private static string StackToString(bool showSame)
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
StackTrace st = new StackTrace(true);
|
StackTrace st = new StackTrace(true);
|
||||||
@ -35,7 +43,7 @@ namespace Volian.Base.Library
|
|||||||
int imax = MatchingStackFrame(sfs);
|
int imax = MatchingStackFrame(sfs);
|
||||||
foreach (StackFrame sf in sfs)
|
foreach (StackFrame sf in sfs)
|
||||||
{
|
{
|
||||||
if (imax == 0)
|
if (showSame && imax == 0)
|
||||||
sb.Append(string.Format("\r\n{0}---------", "".PadLeft(ii++ * 2)));
|
sb.Append(string.Format("\r\n{0}---------", "".PadLeft(ii++ * 2)));
|
||||||
imax--;
|
imax--;
|
||||||
if (ii < 2) ii++;
|
if (ii < 2) ii++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user