public virtual T Load <T>(ModuleInfo module) { var args = new ModuleCancelEventArgs(module); OnModuleLoading(args); if (!args.Cancel) { var instance = (T)module.AssemblyInfo.Assembly.CreateInstance(module.ModuleInitialiser.FullName); OnModuleLoaded(module, instance); return(instance); } return(default(T)); }
protected void OnModuleLoading(ModuleCancelEventArgs args) { ModuleLoading?.Invoke(this, args); }