Giter Site home page Giter Site logo

minusengine's Introduction

MinusEngine

A fully asynchronous C# library to access Minus API.

License

The license for this project is Apache Software License 2.0.

It means you can pretty much do whatever you want with it IF you give back some credit.

Event handling

Every operation has two possible outputs: completion or failure.

Thus, for each operation on the class MinusApi (which in turn represents a call to the actual Minus site) you have to register a success and failure delegate to handle these events.

The asynchronous nature of the library makes it perfect to develop UI-based applications on top of it.

Code sample

// create the API
MinusApi api = new MinusApi("someDummyKey"); // api keys aren't working yet

// setup the success handler for GetItems operation
api.GetItemsComplete += delegate(MinusApi sender, GetItemsResult result)
{
    Console.WriteLine("Gallery items successfully retrieved!\n---");
    Console.WriteLine("Read-only URL: " + result.ReadonlyUrl);
    Console.WriteLine("Title: " + result.Title);
    Console.WriteLine("Items:");
    foreach (String item in result.Items)
    {
        Console.WriteLine(" - " + item);
    }
};

// setup the failure handler for the GetItems operation
api.GetItemsFailed += delegate(MinusApi sender, Exception e)
{
    // don't do anything else...
    Console.WriteLine("Failed to get items from gallery...\n" + e.Message);
};

// trigger the GetItems operation - notice the extra "m" in there.
// while the REAL reader id is "vgkRZC", the API requires you to put the extra "m" in there
api.GetItems("mvgkRZC");

Contact

If you have any questions, please drop me a line on twitter @brunodecarvalho or email me at [email protected]

Dependencies

This project uses the Json.NET library, by James Newton-King.

minusengine's People

Contributors

ddrboxman avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar  avatar

Forkers

miners

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.