paulcbetts/splat — pull request #61 by jlaanstra (2014-05-27 14:06:00+00:00)
Title: Basic plugin support.

This PR adds basic plugin support for the dependency resolver in Splat that works on all platforms including AOT platforms as detailed in https://github.com/reactiveui/ReactiveUI/issues/590#issuecomment-42814055. The idea is based on the plugin framework of MvvmCross that is detailed at https://github.com/MvvmCross/MvvmCross/wiki/MvvmCross-plugins#how-plugins-are-loaded.

Note that the gitignore from #60 is there to stop Roslyn files from being included.

## How does this work:

Class libraries that want to use the Locator from Splat, contain a class implementing `IRegistrations` and add a class to the application project that inherits from `LocatorAction` where `TRegistrations` is the above type that implements `IRegistrations`. This happens via NuGet or manually.

An example can look like this:

```C#
using Splat;

namespace $rootnamespace$.LocatorActions
{
public class YourLibraryLocatorAction : LocatorAction
{
}
}
```

A call to `Locator.Initialize(Assembly)` is necessary for Splat to run all locator actions.
Applications not using the locator from Splat, continue to work without the call to `Initialize(Assembly)`.

## Why do I have to provide an assembly?

The locator needs information about the assembly where the types are located. It is hard to come up with a default that works on all platforms and that does not suck. `Assembly.GetEntryAssembly()` or `Assembly.GetCallingAssembly()` seem like a good candidates for a default, but they can not be used on Windows Phone or Windows Runtime.