本文整理汇总了C#中Trace.Write方法的典型用法代码示例。如果您正苦于以下问题:C# Trace.Write方法的具体用法?C# Trace.Write怎么用?C# Trace.Write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Trace
的用法示例。
在下文中一共展示了Trace.Write方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Run
public int Run()
{
_trace = new Trace("GoryNativePastTest", "0123456");
_trace.Write("0");
try
{
try
{
foo();
}
catch(Exception e)
{
Console.WriteLine(e);
_trace.Write("4");
throw;
}
}
catch(Exception e)
{
_trace.Write("5");
_trace.Write(e.Message);
}
return _trace.Match();
}
示例2: Run
public int Run()
{
_trace = new Trace("CollidedUnwindTest", "0123456789ABCDE");
try
{
_trace.Write("0");
Foo();
}
catch (ExType2 e)
{
Console.WriteLine(e);
_trace.Write("E");
}
return _trace.Match();
}
示例3: Run
public int Run()
{
_trace = new Trace("ThrowInCatchTest", "0123456");
_trace.Write("0");
try
{
_trace.Write("1");
try
{
_trace.Write("2");
throw new Exception(".....");
}
catch(Exception e)
{
Console.WriteLine(e);
_trace.Write("3");
throw new Exception("5");
}
}
catch(Exception e)
{
Console.WriteLine(e);
_trace.Write("4");
_trace.Write(e.Message);
}
_trace.Write("6");
return _trace.Match();
}
示例4: Run
public int Run()
{
_trace = new Trace("TryCatchInFinallyTest", "0123456");
_trace.Write("0");
try
{
_trace.Write("1");
}
finally
{
_trace.Write("2");
try
{
_trace.Write("3");
throw new InvalidProgramException();
}
catch(InvalidProgramException e)
{
Console.WriteLine(e);
_trace.Write("4");
}
_trace.Write("5");
}
_trace.Write("6");
return _trace.Match();
}
示例5: Run
public int Run()
{
_trace = new Trace("ThrowInFinallyTest", "0123456789Ca");
_trace.Write("0");
try
{
_trace.Write("1");
Dumb();
}
catch(Exception e)
{
Console.WriteLine(e);
_trace.Write("9");
_trace.Write(e.Message);
}
_trace.Write("a");
return _trace.Match();
}
示例6: Run
public int Run()
{
_trace = new Trace("BaadbaadTest", "1234");
try
{
DoStuff();
}
catch (Exception e)
{
Console.WriteLine(e);
_trace.Write("4");
}
return _trace.Match();
}
示例7: Run
public int Run()
{
_trace = new Trace("RecursiveRethrow", "210C0C1C2RecursionIsFun");
try
{
LoveToRecurse(2);
}
catch (Exception e)
{
Console.WriteLine(e);
_trace.Write(e.Message);
}
return _trace.Match();
}
示例8: Run
public int Run()
{
_trace = new Trace("RecursiveThrowNew", "210C0(eX)C1(e0)C2(e1)CM(e2)");
try
{
LoveToRecurse(2);
}
catch (Exception e)
{
_trace.Write("CM(" + e.Message + ")");
Console.WriteLine(e);
}
return _trace.Match();
}
示例9: Run
public int Run()
{
_trace = new Trace("ThrowInFinallyNestedInTryTest", "0123456789a");
_trace.Write("0");
try
{
_trace.Write("1");
MiddleMethod();
}
catch(Exception e)
{
Console.WriteLine(e);
_trace.Write("9");
}
_trace.Write("a");
return _trace.Match();
}
示例10: Run
public int Run()
{
_trace = new Trace("BaseClassTest", "0121");
try
{
f1();
}
catch(Exception e)
{
Console.WriteLine(e);
_trace.Write("2" + e.Message);
}
return _trace.Match();
}
示例11: Run
public int Run()
{
_trace = new Trace("RethrowAndFinallysTest", "abcdefF3ED2CB1A[done]");
try
{
_trace.Write("a");
try
{
_trace.Write("b");
try
{
_trace.Write("c");
try
{
_trace.Write("d");
try
{
_trace.Write("e");
try
{
_trace.Write("f");
throw new Exception("ex1");
}
finally
{
_trace.Write("F");
}
}
catch(Exception e)
{
Console.WriteLine(e);
_trace.Write("3");
throw;
}
finally
{
_trace.Write("E");
}
}
finally
{
_trace.Write("D");
}
}
catch(Exception e)
{
Console.WriteLine(e);
_trace.Write("2");
throw;
}
finally
{
_trace.Write("C");
}
}
finally
{
_trace.Write("B");
}
}
catch(Exception e)
{
Console.WriteLine(e);
_trace.Write("1");
}
finally
{
_trace.Write("A");
}
_trace.Write("[done]");
return _trace.Match();
}
示例12: Run
public int Run()
{
_trace = new Trace("GoryManagedPresentTest", "0123456");
try
{
_trace.Write("0");
foo(1234);
_trace.Write("%%%%");
}
catch(Exception e)
{
Console.WriteLine(e);
_trace.Write("6");
}
return _trace.Match();
}