Tuesday, March 20, 2012

CodeStash - Seeing how the sausage is made (well how a Visual Studio Extension...)

CodeProject - CodeStash - a journey into the dark side of Visual Studio, or how I lost my hair

CodeStash source: http://codestash.codeplex.com/

CodeStash Article Listings

Part 1 : CodeStash web site overview / High Level Architecture / How To Install CodeStash
Part 2 : CodeStash web site Low Level Architecture
Part 3 : (This article) CodeStash addin

I beg your indulgence

This article was originally intended to be launched alongside Sacha's two articles. Unfortunately, due to circumstances beyond his control, Sacha is unable to post his articles tonight. Saying that, I did promise that there would be a posting of CodeStash, so I am uploading this part for those who are interested in how I developed the extension. Once Sacha has uploaded his articles, I will come back and update the section above to link to those articles.

I promised that there would be an announcement, and I will not disappoint. When Sacha and I developed CodeStash, which consists of a website and a Visual Studio extension, there was always the question hanging around about how we were going to host the website. We decided that we would initially offer CodeStash as a self-hosting site in order to gauge how useful people found the idea, and to get feedback on the type of features they would like to see.

Obviously, this is not an ideal situation on something which is intended to be a central repository for code snippets. Well, who should step into the fray to help us and to offer to host CodeStash for us but our very own Chris Maunder, who has kindly offered to host the site for us. To this end, we will be working with the Code Project team to turn CodeStash into a Code Project packaged snippet manager. And we need your help. We need you, the Code Project community, to try out CodeStash. We need your requests and your feedback. We need your enthusiasm and your boundless creativity.


What we will cover

In this article, we are going to cover some of the thought processes behind writing a reasonably complex multi-layered Visual Studio extension. We will find out how the commands were put together and how to interact with a well defined REST interface from inside an addin. We will see how we can use MEF to ease the pain of working with shared code, how to interact with internal Visual Studio services and to provide our own property pages.

This article does not teach writing XAML code, or how to use MVVM. We will not be covering how to use Cinch (I would heartily recommend reading Sacha's series on the Cinch framework to get this background). It also does not aim to cover MEF development in great depth, as all these concepts are tangential to the aim of understanding what the CodeStash addin is designed to achieve. CodeStash also makes use of Daniel Grunwald's excellent AvalonEdit control to display snippets, the sheer depth of this control means that I have to recommend reading the original article he wrote to support it; right now I'd just like to say a big thanks to Dan for writing this control and making it freely available.



As you can see from the page snap above, this book... err... I mean... article is very indepth and pretty much just awesome. If you're thinking about creating a VS addin, this is a must read.

No comments: