public void Install(IInstaller installer) { if (_installedInstallers.Where(x => x.GetType() == installer.GetType()).IsEmpty()) // Do not install the same installer twice { _installedInstallers.Add(installer); this.Inject(installer); installer.InstallBindings(); } }
void InstallInstallerInternal(IInstaller installer) { try { installer.InstallBindings(); } catch (Exception e) { // This context information is really helpful when bind commands fail throw new Exception( "Error occurred while running installer '{0}'".Fmt(installer.GetType().Name()), e); } }
protected void InstallBindings <T>(List <T> installers) where T : IInstaller { if (installers != null) { for (int i = 0; i < installers.Count; i++) { IInstaller installer = installers[i]; if (installer != null) { installer.InstallBindings(Container); } else { throw new System.NullReferenceException(string.Format("Null installer reference found in context '{0}'", name)); } } } }