// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using DotNetGuru.AspectDNG.Joinpoints; namespace ESup { public class CallTracker { [AroundCall("* E.*::*(*)")] public static object SaveCall(JoinPoint jp) { if(jp is MethodJoinPoint) { MethodJoinPoint mjp = (MethodJoinPoint)jp; Trace.Instance.PushName(mjp.TargetOperation.DeclaringType.FullName, mjp.TargetOperation.Name); for (int i = 0; i < mjp.Arguments.Length; i++) { Trace.Instance.PushArg(mjp.TargetOperation.GetParameters()[i].ParameterType, mjp.Arguments[i]); } } object res = jp.Proceed(); if(jp is MethodJoinPoint) { Trace.Instance.Pop(); } return res; } } }