scriptcs/scriptcs — pull request #319 by filipw (2013-06-08 14:22:23+00:00)
Title: exported IConsole and ILog from Autofac to MEF Extensions

Autofac does not automatically export components to MEF extensions - it needs to be specified explicitly.

Sine we'd like to give script pack authors ability to use `ILog` and `IConsole` in the script packs, added explicit export of these two interfaces.

You can now do this as a script pack author:

public class TestContext : IScriptPackContext
{
private readonly ILog _logger;
private readonly IConsole _console;

public TestContext(ILog logger, IConsole console)
{
_logger = logger;
_console = console;
}

public void Hello()
{
_logger.Info("Writing hello!");
_console.WriteLine("Hello");
}
}

public class TestPack : ScriptPack
{
[ImportingConstructor]
public TestPack(ILog logger, IConsole console)
{
Context = new TestContext(logger, console);
}
}