Exemple #1
0
        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));
        }
Exemple #2
0
 protected void OnModuleLoading(ModuleCancelEventArgs args)
 {
     ModuleLoading?.Invoke(this, args);
 }