static void Main(string[] args) { var windsorHandler = new WindsorHandler(container => { container.Install( FromAssembly.This(), new MvcInstaller(Classes.FromThisAssembly()), new ConfigurationFactoryInstaller(Types.FromThisAssembly()), new ResolvingInstaller( Classes.FromThisAssembly(), Classes.FromAssemblyContaining <ITeam>()) ); }); Console.Title = "Major League Miruken"; Console.Clear(); var appContext = new Context(); appContext .AddHandlers(windsorHandler, new NavigateHandler(Window.Region)) .AddHandler <IError>(); P <INavigate>(appContext).Next <LayoutController>(x => { x.ShowLayout(); return(true); }); while (!Window.Quit) { } }
public void TestInitialize() { _config = new LoggingConfiguration(); _memoryTarget = new MemoryTarget { Layout = "${date} [${threadid}] ${level:uppercase=true} ${logger} ${message} ${exception:format=tostring}" }; _config.AddTarget("InMemoryTarget", _memoryTarget); _config.LoggingRules.Add(new LoggingRule("*", LogLevel.Debug, _memoryTarget)); LogManager.Configuration = _config; _handler = new WindsorHandler(container => container .AddFacility <LoggingFacility>(f => f.LogUsing(new NLogFactory(_config))) .Install(new FeaturesInstaller( new HandleFeature().AddFilters( new FilterAttribute(typeof(LogFilter <,>))), new ValidateFeature()).Use( Classes.FromAssemblyContaining <HttpRouter>(), Classes.FromThisAssembly())) ); }
public App() { var windsor = new WindsorHandler(container => { container .AddFacility <LoggingFacility>(f => f.UseNLog()) .Install( new MvcInstaller(Classes.FromThisAssembly(), Classes.FromAssemblyContaining <ITeamsView>()), new ConfigurationFactoryInstaller(Types.FromThisAssembly()), new ResolvingInstaller(Classes.FromThisAssembly()) //,new MediatRInstaller( // Classes.FromThisAssembly()) ); }); _appContext.ContextEnded += _ => { windsor.Dispose(); }; _appContext.AddHandlers(windsor, new NavigateHandler(new ViewRegion())); }