Our latest posts and our favorite links, all on your phone or mobile deviceVisit m.LiveSide.netOr go to www.LiveSide.net on your mobile device and we'll redirect you!
Redmond
Dallas (server)
London
Shanghai
LiveSide.net Promote Your Page Too
This is essentially a supplement to Scotts articles on how to write a Windows Live Writer plugin. In this article I'll show you how to implement a simple Amazon Web Service lookup and take that information to create a simple layout for a book review blog post.
Live Writer plugins basically fall into a number of categories but the one in this simple example to get you all started is probably the easiest one to start coding with and is based on the CreateContent API. Windows Live Plugins work in essentially the same way for each type of plugin that you create. You have a main cs (or vb) class file that instantiates any windows forms that you want to use, gather the information then plonk that information into Windows Live Writer. The basic example we'll start coding is a book review template. To make things slightly easier, we use Amazon web services to look certain information about the book and also to get a picture of the front cover of the book.
So far I've shown you how to create basic plugins for Windows Live Writer, in this next guide I'm going to show you how you can use settings in your plugin to make things easier for your end user, you can create default options (that they can customise if you allow them). I'm going to show you how to do exactly that, have the user be able to change the default settings that are applied everytime the plugin is called. I will be carrying this on from my last guide so if you haven't got that already, download the source now.
First thing's first, what options does your plugin need? This is still going to be a simple plugin, so anything you put in can't be changed once inserted, so the options and settings need to be something that the user would want. The simple plugin we have been using so far in this series has been to insert some simple text into the blog entry, so the option I'm going to use is to make it default to use a bold style for the text.
As you all may remember, I wrote a guide on creating your own basic plug-in for Windows Live Writer, well I have now created a template that you can use within Visual Studio and Visual Studio Express so when you create a new project it will put the base code and add in all the references for you, so all you need to do is get cracking and program .
Donavon wrote a gadget for Live.com, Spaces, and the Vista sidebar that counts down to when Vista officially ships to the general public. So I thought I would continue this using the Messenger Add-In APIs and write the same thing but for Messenger and have it display the countdown in your Personal Message area. Now, due to the limitations of the APIs themselves, I found no way to actually have the countdown flow like you would expect, but I have countered that by setting it so that whenever a message is received or sent, or your status is changed, it updates.
So: how do you add this add-in to Messenger? Well, there is no simple way at the moment, but I will give instructions on how to do this. First off, we need to tell Messenger that we want to be able to use Add-ins as Messenger by default doesn't have this option turned on. There is an entry in the Windows registry that we need to add, but for your ease I have a reg file that will do this for you. Just run this registry file and it will make the necessary changes; you will need to fully exit Messenger for this change to take effect.
Most plugins for Live Writer will have a form appear when you click on the Insert link within Live Writer, this form will perform the functionality of the plugin and return the code or text that will be put in the blog entry. Within this form, you can do whatever you want the plugin to do, but for this example I will be keeping it simple and showing the basics, letting you code the rest of the plugin and change whatever settings for your form that you want.