public static void Initialize(NostromoSettings config) { Container.iocImplementation = config.IOCImplementation; if (Container.iocImplementation == null) { throw new Exception("the IOCImplementation isn't specified"); } Container = (new Container()); if (config.ViewActivator != null) { Container.Register <IPlatformViewActivator> (config.ViewActivator); } foreach (var assembly in config.AssembliesToRegisterDependenciesFor ?? new System.Reflection.Assembly[] {}) { Container.RegisterAssemblyDependencies(assembly); } foreach (var assembly in config.AssembliesToRegisterViewsFor ?? new System.Reflection.Assembly[] {}) { if (config.ViewActivator == null) { throw new Exception("the IPlatformViewActivator isn't specified"); } config.ViewActivator.RegisterAssemblyViews(assembly); } }
public static NostromoSettings RegisterAssemblyViews(this NostromoSettings settings, Assembly assembly) { settings.AssembliesToRegisterViewsFor = (settings.AssembliesToRegisterViewsFor ?? new Assembly[] {}) .Concat(new[] { assembly }) .ToArray(); return(settings); }
public static NostromoSettings UseGenericPlatformViewActivator(this NostromoSettings settings, Action <IPlatformViewActivator> withActivator = null) { var activator = new GenericPlatformViewActivator(); if (withActivator != null) { withActivator(activator); } return(settings.UsePlatformViewActivator(activator)); }
public static NostromoSettings RegisterDependenciesInAssemblyOf <TTypeForAssembly>(this NostromoSettings settings) { return(settings.RegisterAssemblyDependencies(typeof(TTypeForAssembly).GetTypeInfo().Assembly)); }
public static void Init(this NostromoSettings config) { NostromoApp.Initialize(config); }
public static NostromoSettings UsePlatformViewActivator(this NostromoSettings settings, IPlatformViewActivator activator) { settings.ViewActivator = activator; return(settings); }
public static NostromoSettings UseAutofacContainer(this NostromoSettings settings) { settings.IOCImplementation = new AutofacContainerImplementation(); return(settings); }