Barse tech

Welcome to the Working Week

Archive for March, 2007

NUnit 2.4

Posted by barse on March 23, 2007

In case you missed it the unit testing framework NUnit 2.4 went final a week ago. A lot has happened “under the hood”. A new FileAssert class, an option to load assemblies in separate AppDomains, a new narrow “mini gui” mode and constraint based assertions are some of the news in this release.

My favourite addition would probably be the CollectionAssert class that really simplifies writing tests for collections. Read more here or go straight ahead and download the new version here.

Posted in Developer tools, Test driven development | No Comments »

C# in the Sidebar

Posted by barse on March 20, 2007

The Sidebar is one of my favourite features in Windows Vista. I like to keep a lot of important and/or interesting information visible. The sidebar is a useful tool to cram even more information into my already overpopulated desktop. (Having around 20 tabs loading at startup in my Opera browser (one of these being Netvibes , in itself containing 13 tabs) I consider myself somewhat of an information junkie.)

Sidebar gadgets are also pretty simple to create so if you find some useful gadget lacking, chances are good that you can put a new one together pretty quickly. It is often possible to make the gadget just using html some lines of javascript and a maybe few XMLHttpRequest()-calls. Sometimes though, you wish for a bit more power, preferrably of the C# variety.

Sadly, I knew now way of easily writing gadgets using C# until yesterday when I found this article at the Code Project. The author has published a small framework for registering and loading a COM object that enables javascript to load an assembly, instantiate objects from that assembly and use them seamlessly in the script. You only have to mark your objects [ComVisible(true)], make sure that your objects implement the IDisposable interface and compile your assembly as a .dll and then you’re good to go.

Put your assembly, the Gadget.Interop.dll and GadgetInterop.js files in your gadget folder and make sure that the search path for the dll files are correct. Then you instantiate the GadgetBuilder object in javascript and call the Initialize method (that registers the Gadget.Interop.dll as a COM object if it hasn’t already done so earlier). After that you can use the GadgetBuilder object to create and dispose of your own home made objects as much as you like.

My first experiment with the GadgetInterop framework, a small gadget for FTP uploads, took me a just a few hours to put together. It’s still quite rough around the edges, but it works. The gadget javascript listens to the onDrop-event and gets the file name from the event.dataTransfer which it sends to an Uploader object that I made in C#. The Uploader object takes care of uploading the file to an FTP server using the FTP url, the username and the password that the user specified in the settings dialog of the gadget.

The GadgetInterop framework opens up a whole new world of possibilities for the Sidebar and I expect to see a lot of interesting new gadgets coming out in the year to come. Aside from this framework, there are a lot of other ways to make cool and useful gadgets, for example Flash, WPF, Java, IE behaviours, VML, Director and a whole lot of other browser based techniques that can be used. Only your imagination is the limit.

Posted in Gadgets | 3 Comments »

One RSS-feed to rule them all

Posted by barse on March 16, 2007

I made a Yahoo Pipe to merge the RSS-feeds from all the bloggers at Dotway. Subscribe here (and prepare to read some really amazing blog posts from a brilliant team of tech heads).

Posted in Dotway | No Comments »

One widget API to rule them all

Posted by barse on March 16, 2007

The thick jungle of gadget, widget, whateverlet API:s seem to be clearing up a bit. Netvibes recently announced the Unified Widget API which aspires to be the “ring to rule them all” if their promises is fulfilled. Starting with support for Netvibes, Google IG and Apple Dashboard, Opera support is soon to follow. Vista Sidebar support is also under development.

Another clearing in the format foliage might be the upcoming gadget/ig product from Donavon West. When (and if) it is released it will consist of a Live.com gadget that can host a Google module. An interesting, albeit somewhat temporary solution to the problem.

Meanwhile, the W3C widget standardization effort slowly works it’s way towards consensus. Here’s the current incarnation.

Posted in Gadgets | No Comments »