private void Form1_Shown(object sender, EventArgs e) { SuspendLayout(); foreach (Expandable exa in Core.loadedModules) { Expandable.Property property = Core.setting.enabledModules.FirstOrDefault(_ => _.name == exa.dllFileName); if (property.name != null && !(bool)property.value) { continue; } loadModule(exa); } switchLanguage(); foreach (Expandable exa in Core.loadedModules) { Hotkey[] hks = exa.hotkeys; if (hks != null) { Core.reloadHotkeys(exa.dllFileName, hks); } } tabControl.SelectedIndex = 0; ResumeLayout(); Core.globalHotkey.start(); }
private static List <Expandable.Property> convertConfig(Expandable.IConfig config) { if (config == null) { return(null); } List <Expandable.Property> fieldList = new List <Expandable.Property>(); Type type = config.GetType(); FieldInfo[] fields = type.GetFields(); foreach (FieldInfo fi in fields) { object value = fi.GetValue(config); //Console.WriteLine(fi.Name + ", as " + fi.FieldType); Expandable.Property property = new Expandable.Property(fi.Name, value); fieldList.Add(property); } return(fieldList); }