/// <summary>
 /// Initializes the current object. Called at compile time by PostSharp.
 /// </summary>
 /// <param name="method">Method to which the current instance is
 /// associated.</param>
 public override void CompileTimeInitialize( MethodBase method )
 {
     this.prefix = Formatter.NormalizePrefix( this.prefix );
     this.formatStrings = Formatter.GetMethodFormatStrings( method );
     MethodInfo methodInfo = method as MethodInfo;
     if ( methodInfo != null )
     {
         this.isVoid = methodInfo.ReturnType == typeof(void);
     }
     else
     {
         this.isVoid = true;
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes the current object. Called at compile time by PostSharp.
        /// </summary>
        /// <param name="method">Method to which the current instance is
        /// associated.</param>
        public override void CompileTimeInitialize(MethodBase method)
        {
            this.prefix        = Formatter.NormalizePrefix(this.prefix);
            this.formatStrings = Formatter.GetMethodFormatStrings(method);
            MethodInfo methodInfo = method as MethodInfo;

            if (methodInfo != null)
            {
                this.isVoid = methodInfo.ReturnType == typeof(void);
            }
            else
            {
                this.isVoid = true;
            }
        }