コード例 #1
0
 replace public void MethodWithoutReturnValueAndParameters()
 {
     try
     {
         AutoTrace.TraceEnterMethod($"Enter: public void TestNamespace.TestStruct.MethodWithoutReturnValueAndParameters()");
         original();
         AutoTrace.TraceLeaveMethod($"Leave: public void TestNamespace.TestStruct.MethodWithoutReturnValueAndParameters()");
     }
     catch (Exception e)
     {
         AutoTrace.TraceException($"Exception: {e.GetType().Name}{Environment.NewLine}{e.Message}");
         throw;
     }
 }
コード例 #2
0
 replace public void MethodWithoutReturnValueWithParameters(Int32 a, String b)
 {
     try
     {
         AutoTrace.TraceEnterMethod($"Enter: public void TestNamespace.TestClass.MethodWithoutReturnValueWithParameters(Int32 a, String b)");
         AutoTrace.TraceParameter($"{nameof(a)} = {a}");
         AutoTrace.TraceParameter($"{nameof(b)} = {b}");
         original(a, b);
         AutoTrace.TraceLeaveMethod($"Leave: public void TestNamespace.TestClass.MethodWithoutReturnValueWithParameters(Int32 a, String b)");
     }
     catch (Exception e)
     {
         AutoTrace.TraceException($"Exception: {e.GetType().Name}{Environment.NewLine}{e.Message}");
         throw;
     }
 }
コード例 #3
0
 replace public Int32 MethodWithReturnValueWithoutParameters()
 {
     try
     {
         AutoTrace.TraceEnterMethod($"Enter: public Int32 TestNamespace.TestClass.MethodWithReturnValueWithoutParameters()");
         var result = original();
         AutoTrace.TraceParameter($"ReturValue = {result}");
         AutoTrace.TraceLeaveMethod($"Leave: public Int32 TestNamespace.TestClass.MethodWithReturnValueWithoutParameters()");
         return(result);
     }
     catch (Exception e)
     {
         AutoTrace.TraceException($"Exception: {e.GetType().Name}{Environment.NewLine}{e.Message}");
         throw;
     }
 }
コード例 #4
0
 replace public String MethodWithReturnValueAndParameters(Int32 a, String b)
 {
     try
     {
         AutoTrace.TraceEnterMethod($"Enter: public String TestNamespace.TestClass.MethodWithReturnValueAndParameters(Int32 a, String b)");
         AutoTrace.TraceParameter($"{nameof(a)} = {a}");
         AutoTrace.TraceParameter($"{nameof(b)} = {b}");
         var result = original(a, b);
         AutoTrace.TraceParameter($"ReturValue = {result}");
         AutoTrace.TraceLeaveMethod($"Leave: public String TestNamespace.TestClass.MethodWithReturnValueAndParameters(Int32 a, String b)");
         return(result);
     }
     catch (Exception e)
     {
         AutoTrace.TraceException($"Exception: {e.GetType().Name}{Environment.NewLine}{e.Message}");
         throw;
     }
 }