Kevin Marshall's Epic Work Blog for Awesome People

@ksmarshall - i <3 software
in

SilverWave: Wrapper for building Google Wave Gadgets in Silverlight

I played around with Wave when I got access to the developer sandbox but quickly lost interest. The technology is cool, but I have no idea what the hell is going on in a Wave. Usability wise I think it’s like MySpace with a slightly less obnoxious UI. Once there are more than 5 people in a Wave and 10+ messages it’s nigh impossible to follow. With the recent launch of the non-sandbox, I thought I’d try again. Performance seems better now at least. Even in Chrome it felt sluggish and Chrome normally rips through Javascript. I think IE8 would just die on that much Javascript – IE8: “Hey, look, this is too much code for me to process and it’s going to be awhile, how about you just check out this web slice instead? Have you heard of Accelerators? I can pop up one of those for you”

So Silverlight and Wave. Maybe it doesn’t make sense to put Silverlight in a Wave, but there are still some things you could do in SL better than HTML5 + JS. Plus I like the irony of having Silverlight in Google’s flagship RIA example. SilverWave is a managed wrapper around the Google Wave gadget APIs so you can code something like:

   1: private void TestWaveAPIs()
   2: {
   3:     txtIsInWaveContainer.Text = WaveManager.Wave.IsInWaveContainer().ToString();
   4:     var viewer = WaveManager.Wave.GetViewer();
   5:     txtViewer.Text = viewer.ToString();
   6:     txtHost.Text = WaveManager.Wave.GetHost().ToString();
   7:     txtGetParticipantById.Text = WaveManager.Wave.GetParticipantById(viewer.Id).ToString();
   8:     txtParticipants.ItemsSource = WaveManager.Wave.GetParticipants();
   9:     txtIsPlayback.Text = WaveManager.Wave.IsPlayback().ToString();
  10:     txtGetTime.Text = WaveManager.Wave.GetTime().ToLocalTime().ToString();
  11:     txtState.Text = WaveManager.Wave.State.ToString();
  12: }

Everything is strongly typed so you can do things like bind to a participant object. The WaveManger class handles all the HTML bridging and callbacks for events like wave state updated. It’s pretty simple and you can get the code here http://code.google.com/p/silverwave/ along with some more instructions. The cross domain stuff seems a little flakey though. Silverlight was loading fine on Saturday for me, then it seems to break. I think the problem is hosting the xap on a non-ssl domain.

image

When it works, the sample on code.google.com looks like the above.

I still have no ideas for an actual Silverlight gadget in a Wave because I have no idea what I’d use Wave for or what a good gadget in Wave would do.  This was just to tide me over until I can further Microsoftize Wave with a wave bot in Azure. Sadly bots only work on app engine for the moment.

If you want to contribute to the code let me know. As of right now I implemented all the wave methods, but there are probably some other useful things that could be added.

Comments

No Comments