<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>DDITDev : Open Source</title><link>http://blogs.msdn.com/dditweb/archive/tags/Open+Source/default.aspx</link><description>Tags: Open Source</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Windows Live Writer Plugins &amp; Dirty Diapers!</title><link>http://blogs.msdn.com/dditweb/archive/2007/02/19/windows-live-writer-plugins-dirty-diapers.aspx</link><pubDate>Tue, 20 Feb 2007 04:00:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1720082</guid><dc:creator>dditweb</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/dditweb/comments/1720082.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dditweb/commentrss.aspx?PostID=1720082</wfw:commentRss><wfw:comment>http://blogs.msdn.com/dditweb/rsscomments.aspx?PostID=1720082</wfw:comment><description>&lt;P&gt;I've been playing around with Windows Live Writer for a little while now (since it first came out in beta!) and the more I use it, the better it seems to get (in case you haven't used it, I encourage you to &lt;A href="http://ideas.live.com/programpage.aspx?versionId=4372c8c2-b76f-4d44-aea1-9835b61d8dc1" target=_blank mce_href="http://ideas.live.com/programpage.aspx?versionId=4372c8c2-b76f-4d44-aea1-9835b61d8dc1"&gt;check it out&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;The only "problem" I've had so far is my lack of understanding on how to create plugins for it. Well my friends - I've worked it out and I intend to share it with you now!&lt;/P&gt;
&lt;P&gt;Oh! Before I go any further, let me explain the title of this post...&lt;/P&gt;
&lt;P&gt;I've been wanting to write this post for a little while now, but this is the first chance I've had to sit down and have some "time to myself". My wife and I welcomed our new baby daughter into the world a few weeks ago and since then my world has been turned upside down! When I'm not changing diapers, or bonding my her and my wife, I like to try and catch up on the little sleep I seem to be getting at the moment! But just for you (OK.. and me!) I have managed to escape to my office for a while&amp;nbsp;and finally get this article "out the door"... ;)&lt;/P&gt;
&lt;P&gt;Anyway,&amp;nbsp;let's get going!&lt;/P&gt;
&lt;P&gt;The first step to writing a plugin was working out what I wanted it to do. I finally settled on creating a plugin to insert a thumbnail image of any given web page and have it appear as an image in your blog&amp;nbsp;post. &lt;/P&gt;
&lt;P&gt;I was going to write this post about how you create a plugin yourself, but I thought the best way to show you would be to provide the source code for my plugin!&lt;/P&gt;
&lt;P&gt;A few points worth mentioning...&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;When creating a plugin, make sure you add a reference to the WindowsLive.Writer.Api.dll file located in the Program Files\Windows Live Writer directory. 
&lt;LI&gt;Make sure you add attributes to your class describing the plugin. This is how Windows Live Writer "learns" about your plugin. Mine looks like this:&lt;/LI&gt;&lt;/OL&gt;
&lt;DIV style="FONT-SIZE: 9pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: consolas"&gt;
&lt;P style="MARGIN: 0px"&gt;[&lt;SPAN style="COLOR: #2b91af"&gt;InsertableContentSource&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #a31515"&gt;"Website Image"&lt;/SPAN&gt;),&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;WriterPlugin&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #a31515"&gt;"32a77b7a-5ea4-47be-84fc-ff7471384e10"&lt;/SPAN&gt;, &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"InsertWebsiteImagePlugin"&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; ImagePath = &lt;SPAN style="COLOR: #a31515"&gt;"Web.png"&lt;/SPAN&gt;, &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; PublisherUrl = &lt;SPAN style="COLOR: #a31515"&gt;"http://blogs.msdn.com/jasonward/"&lt;/SPAN&gt;, &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; Description = &lt;SPAN style="COLOR: #a31515"&gt;"Inserts a thumbnail image of a website into the Live Writer Window"&lt;/SPAN&gt;), &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;LiveClipboardContentSource&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #a31515"&gt;"html"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #a31515"&gt;"text/html"&lt;/SPAN&gt;), &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;UrlContentSource&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #a31515"&gt;"http://(.*)"&lt;/SPAN&gt;, &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; ProgressCaption = &lt;SPAN style="COLOR: #a31515"&gt;"Capturing Website Image.."&lt;/SPAN&gt;, &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; RequiresProgress = &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;)]&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;InsertWebsiteImage&lt;/SPAN&gt; : &lt;SPAN style="COLOR: #2b91af"&gt;SmartContentSource&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;So what's the plugin called and where can I get it?&lt;/P&gt;
&lt;P&gt;It's called "Insert Website Image" and you can download it from &lt;A href="http://gallery.live.com/liveItemDetail.aspx?li=130a9668-3e0d-4d43-a7b2-a0d06aafa8a4&amp;amp;l=8" target=_blank mce_href="http://gallery.live.com/liveItemDetail.aspx?li=130a9668-3e0d-4d43-a7b2-a0d06aafa8a4&amp;amp;l=8"&gt;here&lt;/A&gt;!&lt;/P&gt;
&lt;P&gt;All source code can also be downloaded from &lt;A href="http://www.codeplex.com/WindowsLiveWriter/" target=_blank mce_href="http://www.codeplex.com/WindowsLiveWriter/"&gt;here&lt;/A&gt;!&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;BR&gt;Jason&lt;/P&gt;
&lt;P&gt;p.s - I've hosted all the source code on &lt;A href="http://www.codeplex.com/" target=_blank mce_href="http://www.codeplex.com/"&gt;codeplex&lt;/A&gt;, so if you'd like to contribute to this plugin or perhaps even add your own plugin to this project, please let me know!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1720082" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dditweb/archive/tags/Windows+Live+Writer/default.aspx">Windows Live Writer</category><category domain="http://blogs.msdn.com/dditweb/archive/tags/Open+Source/default.aspx">Open Source</category><category domain="http://blogs.msdn.com/dditweb/archive/tags/Jason/default.aspx">Jason</category></item></channel></rss>