public CaliburnServiceLocatorApplication()
        {
            var locator = new MugenServiceLocator(Kernel);

            ServiceLocator.SetLocatorProvider(() => locator);

            Kernel.Bind <IInjector>().ToConstant(Kernel);
            Kernel.Bind <MugenInjector>().ToConstant(Kernel);
            Kernel.Bind <MugenServiceLocator>().ToConstant(locator);
            Kernel.Bind <IServiceLocator>().ToConstant(locator);
        }
Exemplo n.º 2
0
 private void RegisterConditional()
 {
     // conditional export
     container.Bind <ImportConditionObject>().To <ImportConditionObject>().InTransientScope();
     container.Bind <ImportConditionObject2>().To <ImportConditionObject2>().InTransientScope();
     container.Bind <IExportConditionInterface>()
     .To <ExportConditionalObject>()
     .WhenIntoIsAssignable <ImportConditionObject>()
     .InTransientScope();
     container.Bind <IExportConditionInterface>()
     .To <ExportConditionalObject2>()
     .WhenIntoIsAssignable <ImportConditionObject2>()
     .InTransientScope();
 }