Gallery2 remote API C# wrapper

I stumbled across the Gallery.NET Toolkit on Twitter, while I should have been doing something more useful; some great work from @rmaclean (thanks for sharing / codeplexing  it).

The API wraps up a lot of the Gallery2 remote services into some easy to use C# functions.

Actions a = new SADev.Gallery2.Protocol.Actions("http://www.blakepics.com");
string authToken = a.Login("*************", "*************").AuthToken;
a.FetchAlbums(authToken).Albums.ForEach(
    album =>
    {
        Console.WriteLine(album.Title);
        a.FetchImages(authToken, album.Name).Images.ForEach(image =>
            Console.WriteLine("\t" + image.Url)
        );
    }
    );
Console.ReadKey();

Hopefully I’ll find an excuse to use this one day.

1 Comment

  • #1 by Robert MacLean on July 1, 2009 - 9:33 pm

    Reply Quote

    Hi,

    Thanks for the mention ;) I’m blown away by your sample code there – such a different way of using it, which I never though of.