public void Trigger <TArg>(string methodName, TArg parameter) { Bootstrappers.ForEach(bootstrapper => ExecuteIfNotNull( bootstrapper.GetType() .GetMethod(methodName, new[] { typeof(TArg) }), methodInfo => methodInfo.Invoke(bootstrapper, new object[] { parameter })) ); }
public void TriggerConfigure(Func <Type, object> serviceLocator = null) { Bootstrappers.ForEach(bootstrapper => { Config.ConfigureMethods .Where(c => c.Value()) .ToList() .ForEach(methodConfiguration => ExecuteIfNotNull( GetMethodInfoByName(bootstrapper.GetType(), methodConfiguration.Key, serviceLocator), methodInfo => methodInfo.InvokeWithDynamicallyResolvedParameters(bootstrapper, serviceLocator)) ); }); }
private static void LoadBootstrappers() { Bootstrappers = GetClassesOfType <IBootstrapper>(); Bootstrappers.ForEach(b => b.Init()); }