public WinFormium Build() { ILogger logger; if (_container.IsRegistered <ILogger>()) { logger = _container.GetInstance <ILogger>(); } else { logger = new DefaultLogger(); _container.RegisterInstance(logger); } _context.Properties[typeof(ILogger)] = logger; return(new WinFormium(new Runtime(_options))); }
public void can_add_a_type_handler() { container.AddHandler(typeof(ITestService), () => new TestService()); container.IsRegistered(typeof(ITestService)).ShouldBeTrue(); }