Powershell and the Live Framework SDK?

I have this little command line app that I’ve been using to navigate my developer Mesh with the Live Framework SDK.

It started out as very basic but then today I realised that I should really extend it so that you can use it something like;

cd cloud

list objects

cd meshObject1

list objects

and so on. I was about to set about doing this when I realised that this is essentially already part of Powershell and a much smarter move would be for me to write a plug-in provider for Powershell that exposed the local/cloud Live Operating Environment as something that can be navigated from the shell.

Now…I didn’t actually set about it yet ( mostly because I realised that I’d have to download the entire Windows SDK to get going – can that be right? 🙂 )

If anyone goes ahead and builds it then let me know and I’ll link to it here, otherwise I’ll try and build it myself when “spare time” comes around.

Live Framework SDK – Revised WPF Photo Sharing Application

I’ve taken the application that I last mentioned here and I’ve been working on it a little more. I’m not quite where I want to be just yet but I thought I’d walk through it a little and share the code.

The application runs up like this;

image

and it immediately tries to connect to the Local Live Operating Environment ( it depends on a Local Live Operating Environment ( LOE ) and will fail if you don’t have one ).

It pulls the user id from that Local LOE and offers a chance to log in but you can skip it if you like as it’s only needed for Contacts which have to come from the Cloud LOE as the Live Framework doesn’t make them available from the Local LOE yet.

Either way, it then shows something like this;

image

one that UI is present I can drag and drop single photos or multiple photos from the desktop to the UI as in;

image

It’s not possible to see the drop location on the screen capture above but it’s over the window on the left where I’m about to drop the 3 selected image files. On the right is a Virtual PC where I have a Windows XP machine running the same client using the same Live Id.

So, if I drop the 3 images I should get a new photo album;

image

and I captured the screenshot after the data had sync’d across to the client running on Windows XP.

Now, I can rename the photo album by just clicking on the label;

image

although ( unfortunately ) that change does not seem to get sync’d across to the other machine at this point – I’m investigating MeshObject.ChangeNotificationReceived for this and I believe that it doesn’t work in the current preview bits so I’m missing a change notification somewhere here.

I can also add new photos to that album by dragging and dropping;

image

again – the screen capture doesn’t quite capture that I’m dragging the car photo onto the Critters album. If I drop it and then double click on the album I can see ( on both the VPC and my own PC – notice the VPC has the wrong album name 😦 );

image

and then I can go and rename the photos on either of these machines ( which works ok ) and/or drag new pictures into the album on this display as well.

image

and I can select any number of images and hit the delete key and that’ll replicate in both places;

image

image

I can then navigate back up to the albums view;

image

where I can delete albums in the same way if I want to or I can drag more photos to create another album;

image

and then rename that as a “Cars” album;

image

Now if I login to MESH locally as one account and on my Virtual PC as another account as in;

image

and then re-run the application and either log-in to the Cloud LOE when it first asks me or Click on the Contacts tab which will ask the same question ( because it needs the Cloud LOE as previously explained );

image

then it asynchronously goes to get my Contacts from the Cloud LOE;

image image image

and now my “left hand” user has no albums and my right hand user has the 2 albums I made previously ( with the wrong names );

image

my “left hand” user can go ahead and create a new album;

image

and then open the contacts tab ( note, I blanked a few of my contacts out here – those black rectangles aren’t actually on the UI 🙂 );

image

and then drag a contact across to that album;

image

At that point, the code goes off to invite the contact(s) that have been dropped into this particular MeshObject.

This is a relatively lengthy process and involves an email travelling to the invited contacts and they then open that email, click a link which takes them to the Live Desktop and they either accept/decline the invitation that’s been sent to them. I have some screenshots of this process here.

It’d be nice if there was some way for this invitation process to be managed without having to leave a rich client environment. Going via a route of [rich client]->[email]->[browser]->[rich client] feels like too lengthy a process to me but it’s the only way in which this can be done today.

Once the receiving user ( which for me, is the “right hand side” of my screen running in a VPC ) has accepted the invitation then their UI should update with a new photo album;

image

and that album has a little “Messenger” icon to indicate that it’s someone else’s album and so you can’t change its title, add photographs to it or invite your own Contacts to share it but you can browse it.

Note – that “read only” nature is not a restriction of the Live Framework, I just decided arbitrarily that you’d not really want someone else messing around with your photo albums that you’d shared with them.

The Contacts UI tries to reflect the current selected album in that it hides Contacts that are already members of that album as in;

image

but it doesn’t do that right now without a re-start of the app following a successful invite 😦 and if you do a multi-select it’ll display UI to say it can’t handle multi-select 🙂

Unusually for me, this code comes with a license.

That’s because I’ve picked up a couple of themes for WPF controls that I got from CodePlex and those themes originated in Silverlight so they also make use of the Visual State Manager and so that meant bringing in the WPF Toolkit from CodePlex as well.

After all that – here’s the current code for download if anyone wants to have a play around with it.