コード例 #1
0
            protected override T Intercept <T>(Expression expr, System.Func <T> continuation)
            {
                Trace parentTrace = currentTrace;
                Trace trace       = new Trace(expr);

                try
                {
                    currentTrace.AddChild(trace);
                    currentTrace = trace;

                    T result = base.Intercept(expr, continuation);
                    trace.Result = result;
                    return(result);
                }
                catch (AbruptTerminationException ex)
                {
                    trace.Exception = ex.Trace.Exception;
                    throw;
                }
                catch (Exception ex)
                {
                    trace.Exception = ex;
                    throw new AbruptTerminationException(trace);
                }
                finally
                {
                    currentTrace = parentTrace;
                }
            }