Welcome Guest, you are in: Login

dbones docs

RSS RSS

Navigation (boxes)




Search the wiki
»

What is the Boxes Project

RSS
Modified on 2013/08/01 21:17 by Dave Categorized as Uncategorized
The Boxes Project consists of a set of libraries to handle application composition. The aim of the Project is to simplify this task of a plug-in architecture for applications using the .NET Framework.


There are 2 main projects in this collection:

  • Boxes.Core – the main framework which does package discovery, dependency isolation and management.
  • Boxes.Integration - utilises Boxes.Core and provides a possible way to support package composition via a container.

These libraries offer you the freedom to implement Boxes in the best way to suit your application (an IoC Container is not required with Boxes.Core).

Show me some code

Below is an example of using Boxes.Core, as you can see it has a very small API footprint.


PackageRegistry registry = new PackageRegistry();
using (IsolatedLoader loader = new IsolatedLoader(registry))
{
    registry.DiscoverPackages(new PackageScanner(packageDirectory));
    registry.LoadPackages(loader);

    //now you can do anything with the packages
    IEnumerable<Type> allExportedTypes = 
        registry.Packages
        .SelectMany(x => x.LoadedAssemblies)
        .SelectMany(x => x.GetExportedTypes());

    foreach (var exportedType in allExportedTypes)
    {
        Console.WriteLine(exportedType);
    }
}
dbones docs, is a sub-site of dbones.co.uk, all its content belongs to dbones.co.uk, this also includes logo's.