private static void SaveModule(string name, Type type) { var prop = new DeepCore.Properties(); prop.SaveStaticFields(type); File.WriteAllText(Application.StartupPath + "/bot.module." + name + ".save", prop.ToString(), CUtils.UTF8); }
private static void LoadModule(string name, Type type) { if (File.Exists(Application.StartupPath + "/bot.module." + name + ".save")) { var text = File.ReadAllText(Application.StartupPath + "/bot.module." + name + ".save", CUtils.UTF8); if (text != null) { var prop = new DeepCore.Properties(); prop.TryParseText(text); prop.LoadStaticFields(type); } } }