/// <summary> /// Gets a string representing a concrete method invocation. /// </summary> /// <param name="instance">Instance on which the method is invoked, or <b>null</b> with a static method.</param> /// <param name="method">Invoked method.</param> /// <param name="invocationParameters">Concrete invocation parameters.</param> /// <returns>A representation of the method invocation.</returns> public string Format( object instance, MethodBase method, object[] invocationParameters) { string[] parts = new string[4] { typeIsGeneric ? TraceFormatter.FormatString(this.typeFormat, method.DeclaringType.GetGenericArguments()) : this.typeFormat, methodIsGeneric ? TraceFormatter.FormatString(this.methodFormat, method.GetGenericArguments()) : this.methodFormat, instance == null ? "" : string.Format("{{{0}}}", instance), TraceFormatter.FormatString(this.parameterFormat, invocationParameters) }; return(string.Concat(parts)); }
/// <summary> /// Called at compile-time to initialize the current custom attribute instance. /// We compute the formatting strings. /// </summary> /// <param name="method">Method to which the current custom attribute is /// applied.</param> public override void CompileTimeInitialize(MethodBase method, AspectInfo aspectInfo) { this.strings = TraceFormatter.GetMethodFormatStrings(method); }