using System; using Stylet; using StyletIoC; using log4net.Core; using log4net; using Server.Pages; using Server.Database; using Server.Config; using Server.Http;
protectedoverridevoidConfigureIoC(IStyletIoCBuilder builder) { // Configure the IoC container in here
// 注册 IoC var userConfig = new UserConfig(); builder.Bind<UserConfig>().ToInstance(userConfig); builder.Bind<LiteDBManager>().ToInstance(new LiteDBManager(userConfig));
base.ConfigureIoC(builder); }
// 在此处获取 Container, 其它地方获取的都是空 protectedoverridevoidConfigure() { // Perform any other configuration before the application starts // 加载静态网页服务 _httpServer = new HttpServiceMain(); _httpServer.Start(Container);