title: PostSharp Pointcuts
body: <p>Before I start, I'd like to clarify that my current understanding of AOP terminology is as follows...</p>
  
  <ul>
  <li>Aspects are the AOP equivalent of Classes in OOP.</li>
  <li>Advices are the AOP equivalent of Methods in OOP.</li>
  <li>Pointcuts are the AOP equivalent of 'using' code in OOP. In OOP we invoke things. In AOP we weave things. The decision of <em>what</em> to weave <em>where</em> is defined by Pointcuts.</li>
  </ul>
  
  <p>Onto the actual question...</p>
  
  <p>I have a logging aspect in PostSharp which I want to use (weave) on every method, excluding properties. Originally I was using the following on my aspect:</p>
  
  <pre><code>[MulticastAttributeUsage(MulticastTargets.Method, TargetMemberAttributes = MulticastAttributes.Instance)]
  </code></pre>
  
  <p>However, I found the aspect was still being woven into properties, meaning I had to perform a secondary check at runtime to preclude my code from executing on properties:</p>
  
  <pre><code>if (!methodName.StartsWith("set_") &amp;&amp; !methodName.StartsWith("get_")) {
  </code></pre>
  
  <p>This is not ideal. I should be able to define this behavior in my pointcut so that I don't have to perform any runtime checking.</p>
  
  <p>I have been looking into the <code>MethodPointcut</code> attribute which appears to provide me with a callback to help the weaver select candidates for the advice at build time. <em>Please can I see an example?</em></p>
  
  <p>Assuming this does work, I am still left thinking 'Why must I hardcode Pointcuts to my Advices?'. Aspects and Advices are the definition/implementation. Pointcuts are the usage. The two should be seperate.</p>