public override void OnEntry(FunctionExecutionArgs <List <AspectJoinPoints>, string> args) { args.FlowBehavior = FlowBehavior.Continue; args.Arg1.Add(AspectJoinPoints.OnEntry); args.AddToReturnValue(AspectJoinPoints.OnEntry); base.OnEntry(args); }
public override void OnSuccess(FunctionExecutionArgs <List <AspectJoinPoints>, List <AspectJoinPoints>, List <AspectJoinPoints>, string> args) { args.Arg1.Add(AspectJoinPoints.OnSuccess); args.Arg2.Add(AspectJoinPoints.OnSuccess); args.Arg3.Add(AspectJoinPoints.OnSuccess); base.OnSuccess(args); }
public override void OnEntry(FunctionExecutionArgs <int, int, int, int, int, int, int, int, string> args) { args.FlowBehavior = FlowBehavior.Continue; args.Arg8 = args.Arg7 = args.Arg6 = args.Arg5 = args.Arg4 = args.Arg3 = args.Arg2 = args.Arg1 += (int)AspectJoinPoints.OnEntry; args.AddToReturnValue(AspectJoinPoints.OnEntry); base.OnEntry(args); }
public override void OnExit(FunctionExecutionArgs <List <AspectJoinPoints>, List <AspectJoinPoints>, string> args) { args.Arg1.Add(AspectJoinPoints.OnExit); args.Arg2.Add(AspectJoinPoints.OnExit); args.AddToReturnValue(AspectJoinPoints.OnExit); base.OnExit(args); }
public override void OnSuccess(FunctionExecutionArgs <string> args) { stopwatch.Stop(); Console.WriteLine("{0} OnSuccess", args.Method.Name); Console.WriteLine("Elapsed Ticks: {0}", stopwatch.ElapsedTicks); Console.WriteLine("Return value: {0}", args.ReturnValue); }
public override void OnSuccess(FunctionExecutionArgs args) { // Store in cache _cache.Add((string)args.Tag, args.ReturnValue, new CacheItemPolicy { AbsoluteExpiration = DateTime.UtcNow + _cacheTimeout }); }
public override void OnExit(FunctionExecutionArgs args) { var sw = (Stopwatch)args.Tag; sw.Stop(); Debug.WriteLine("{0} executed in {1} milliseconds", args.FunctionName, sw.ElapsedMilliseconds); }
public void OnEntry(FunctionExecutionArgs args) { if (ExcelDnaUtil.IsInFunctionWizard()) { args.ReturnValue = _dialogResult; args.FlowBehavior = FlowBehavior.Return; } // Otherwise we do not interfere }
public override void OnEntry(FunctionExecutionArgs args) { // FunctionExecutionArgs gives access to the function name and parameters, // and gives some options for flow redirection. // Tag will flow through the whole handler args.Tag = args.FunctionName + ":" + Index; Debug.Print("{0} - OnEntry - Args: {1}", args.Tag, string.Join(",", args.Arguments.Select(arg => arg.ToString()))); }
internal static void AddToReturnValue(this FunctionExecutionArgs <string> args, AspectJoinPoints joinPoint) { if (args.ReturnValue.IsNullOrEmpty()) { args.ReturnValue = joinPoint.ToString(); return; } args.ReturnValue = format.Fmt(args.ReturnValue, joinPoint.ToString()); }
public override void OnExit(FunctionExecutionArgs <List <AspectJoinPoints>, List <AspectJoinPoints>, List <AspectJoinPoints>, List <AspectJoinPoints>, List <AspectJoinPoints>, List <AspectJoinPoints>, List <AspectJoinPoints>, string> args) { args.Arg1.Add(AspectJoinPoints.OnExit); args.Arg2.Add(AspectJoinPoints.OnExit); args.Arg3.Add(AspectJoinPoints.OnExit); args.Arg4.Add(AspectJoinPoints.OnExit); args.Arg5.Add(AspectJoinPoints.OnExit); args.Arg6.Add(AspectJoinPoints.OnExit); args.Arg7.Add(AspectJoinPoints.OnExit); base.OnExit(args); }
string GenerateKey(FunctionExecutionArgs args) { var keyBuilder = new StringBuilder(args.FunctionName); foreach (var arg in args.Arguments) { keyBuilder.Append('\0'); // 0-delimited !? keyBuilder.Append(arg); } return(keyBuilder.ToString()); }
public override void OnEntry(FunctionExecutionArgs <List <AspectJoinPoints>, List <AspectJoinPoints>, List <AspectJoinPoints>, List <AspectJoinPoints>, List <AspectJoinPoints>, List <AspectJoinPoints>, List <AspectJoinPoints>, string> args) { args.FlowBehavior = FlowBehavior.Continue; args.Arg1.Add(AspectJoinPoints.OnEntry); args.Arg2.Add(AspectJoinPoints.OnEntry); args.Arg3.Add(AspectJoinPoints.OnEntry); args.Arg4.Add(AspectJoinPoints.OnEntry); args.Arg5.Add(AspectJoinPoints.OnEntry); args.Arg6.Add(AspectJoinPoints.OnEntry); args.Arg7.Add(AspectJoinPoints.OnEntry); base.OnEntry(args); }
public override void OnException(FunctionExecutionArgs <List <AspectJoinPoints>, string> args) { var ex = args.Exception; if (ex.IsNotNull() && ex.GetType() == typeof(Exception) && ex.Message.Equals("InMethodException")) { args.Arg1.Add(AspectJoinPoints.OnException); args.AddToReturnValue(AspectJoinPoints.OnException); } base.OnException(args); }
public override void OnException(FunctionExecutionArgs <int, int, int, int, int, int, int, int, string> args) { var ex = args.Exception; if (ex.IsNotNull() && ex.GetType() == typeof(Exception) && ex.Message.Equals("InMethodException")) { args.Arg8 = args.Arg7 = args.Arg6 = args.Arg5 = args.Arg4 = args.Arg3 = args.Arg2 = args.Arg1 += (int)AspectJoinPoints.OnException; args.AddToReturnValue(AspectJoinPoints.OnException); } base.OnException(args); }
public override void OnEntry(FunctionExecutionArgs <List <AspectJoinPoints>, List <AspectJoinPoints>, List <AspectJoinPoints>, List <AspectJoinPoints>, List <AspectJoinPoints>, List <AspectJoinPoints>, List <AspectJoinPoints>, string> args) { args.Arg1.Add(AspectJoinPoints.OnEntry); args.Arg2.Add(AspectJoinPoints.OnEntry); args.Arg3.Add(AspectJoinPoints.OnEntry); args.Arg4.Add(AspectJoinPoints.OnEntry); args.Arg5.Add(AspectJoinPoints.OnEntry); args.Arg6.Add(AspectJoinPoints.OnEntry); args.Arg7.Add(AspectJoinPoints.OnEntry); args.AddToReturnValue(AspectJoinPoints.OnEntry); base.OnEntry(args); }
public override void OnEntry(FunctionExecutionArgs args) { string key = GenerateKey(args); args.Tag = key; object result = _cache[key]; if (result != null) { // Set the return value and FlowBehavior, to short-cut the function call args.ReturnValue = result; args.FlowBehavior = FlowBehavior.Return; } }
public override void OnExit(FunctionExecutionArgs <int, int, int, int, int, int, int, int, string> args) { args.Arg8 = args.Arg7 = args.Arg6 = args.Arg5 = args.Arg4 = args.Arg3 = args.Arg2 = args.Arg1 += (int)AspectJoinPoints.OnExit; args.AddToReturnValue(AspectJoinPoints.OnExit); base.OnExit(args); }
public override void OnSuccess(FunctionExecutionArgs <int, int, int, int, int, int, int, int, string> args) { args.Arg1 = args.Arg1 + (int)AspectJoinPoints.OnSuccess; args.AddToReturnValue(AspectJoinPoints.OnSuccess); base.OnSuccess(args); }
public override void OnEntry(FunctionExecutionArgs <int> args) { base.OnEntry(args); }
public override void OnSuccess(FunctionExecutionArgs <int, int, int, int> args) { Console.WriteLine("Code from TraceAspect3 OnSuccess"); base.OnSuccess(args); }
public void OnException(FunctionExecutionArgs args) { }
public override void OnExit(FunctionExecutionArgs <int, int, int, string> args) { args.Arg3 = args.Arg2 = args.Arg1 += (int)AspectJoinPoints.OnExit; base.OnExit(args); }
public override void OnEntry(FunctionExecutionArgs <int, int, int, string> args) { args.FlowBehavior = FlowBehavior.Continue; args.Arg3 = args.Arg2 = args.Arg1 += (int)AspectJoinPoints.OnEntry; base.OnEntry(args); }
public override void OnEntry(FunctionExecutionArgs <int, int, int, string> args) { args.Arg3 = args.Arg2 = args.Arg1 += (int)AspectJoinPoints.OnEntry; args.AddToReturnValue(AspectJoinPoints.OnEntry); base.OnEntry(args); }
public void OnExit(FunctionExecutionArgs args) { }
public override void OnEntry(FunctionExecutionArgs <string, string> args) { }
public override void OnExit(FunctionExecutionArgs <int, int, int, int> args) { Console.WriteLine("Code from TraceAspect3 OnExit"); args.Arg1 = 10; base.OnExit(args); }
public override void OnEntry(FunctionExecutionArgs <int, bool> args) { }
// Implemented just to satisfy the interface public void OnSuccess(FunctionExecutionArgs args) { }