private void ScanModules() { try { /* loop through all available modules and add valid ones to available list */ foreach (Type t in Assembly.GetEntryAssembly().GetTypes()) { if (!t.IsSubclassOf(typeof (Module))) continue; // check if type is a subclass 'Module'. var moduleInfo = new ModuleController(t); if (moduleInfo.Valid) AvailableModules.Add(moduleInfo.Attributes.Name, moduleInfo); } } catch (ReflectionTypeLoadException e) { foreach (Exception exc in e.LoaderExceptions) { LogManager.Instance.Write(LogMessageTypes.Fatal, string.Format("Exception caught during scanning of available modules: {0}", exc)); } } }
public ListviewModuleItem(ModuleController p) { this.ImageKey = p.Attributes.Name; this.SubItems.Add(p.Attributes.Name); this.SubItems.Add(p.Attributes.Description); }