Project Description
Create attributes that execute code when their target members are called.

Sample

public class TraceAttribute : ActiveAttribute
{
  public override void OnIntercept (IInvocation invocation)
  {
    Console.WriteLine ("Calling " + invocation.Method.Name + " (" 
            + string.Join (", ", invocation.Arguments.Select (arg => arg.Value)) + ")");

    invocation.Proceed();

    Console.WriteLine ("Exiting " + invocation.Method.Name);
  }
}

(Disclaimer: The API is subject to change.)

Last edited Jul 18, 2012 at 11:39 AM by matkoch, version 7