I’ve used resharper for a while now and i notice that it sometimes adds advise to your code such as this:

I’m writing a visual studio add-in where i’d like to do the same thing.
Could anyone point me in the right direction?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Hadi Hariri has written some good introductions to extend Resharper either with plugins:
http://hadihariri.com/2010/01/12/writing-plug-ins-for-resharper-part-1-of-undefined/
http://hadihariri.com/2010/07/20/writing-plug-ins-for-resharper-part-2-of-n/
… or with a new custom pattern matching feature in Resharper 5.
http://hadihariri.com/2010/08/19/highlighting-custom-patterns-with-resharper/
For getting started with writing the plugin Hadi describes, reference the following dll’s from the Resharper install directory:
And for getting further checkout the source Resharper PowerToys:
http://resharperpowertoys.codeplex.com/
Mind that there are some differences in how to implement the plugins between Resharper versions.