/// <summary> /// Ensure the container is configured. /// Optionally force it to be re-configured. /// </summary> /// <param name="force"></param> public static void Configure(bool force) { // If the kernel hasn't been created or the call is forcing a new one do something, otherwise, just exit if (Singleton <TinyIoCContainer> .Instance == null || force) { lock (ContainerCreationLockObject) { // someone may have waited for the lock, but it has been built for them, check one more time. if (Singleton <TinyIoCContainer> .Instance == null || force) { var container = new TinyIoCContainer(); CoreDependencyRegistrar.Register(container); // register everything! RegisterDependencyRegistrar(TypeFinder, container); // set the kernel to the static accessor Singleton <TinyIoCContainer> .Instance = container; // run all startup tasks RunStartupTasks(container); } } } }
public virtual TinyIoCContainer BuildTestContainer() { var container = new TinyIoCContainer(); CoreDependencyRegistrar.Register(container); foreach (var dependencyRegistrar in GetDependencyRegistrars().OrderBy(x => x.Importance)) { dependencyRegistrar.Register(container); } return(container); }
static void Main(string[] args) { try { CoreDependencyRegistrar.Register(); var serviceRunner = ObjectFactory.GetInstance <IServiceRunner>(); Logger.Info(serviceRunner, "Tarantino.Daemon MachineConsole starting"); serviceRunner.Start(); } catch (Exception exc) { System.Console.WriteLine("MachineConsole failed to run: {0}", exc); throw; } }
public DefaultService() { try { CoreDependencyRegistrar.Register(); Logger.Info(this, "Tarantino.Daemon Service starting"); ServiceName = SERVICE_NAME; _serviceRunner = ObjectFactory.GetInstance <IServiceRunner>(); Logger.Info(this, "Service Runner loaded"); } catch (Exception exc) { Logger.Fatal(this, "Service failed to start", exc); throw; } }
public void Test() { CoreDependencyRegistrar.Register(); }
public void Setup() { CoreDependencyRegistrar.Register(); }