public static void LoadConfig() { using (StreamReader file = new StreamReader(FileManager.configFile.FullName)) { string line = file.ReadLine(); if (line == null) { return; } if (line != "") { Profile activeProfile = ProfileManager.TryGetProfileNamed(line); if (activeProfile != null) { ProfileManager.activeProfile = activeProfile; } } /* * line = file.ReadLine(); * if (line == null) return; * if (line == "True") * { * ProfileManager.loadOnStartup = true; * } * else if (line == "False") * { * ProfileManager.loadOnStartup = false; * }*/ } }
public static void TryLoadProfile(FileInfo file) { if (ProfileManager.TryGetProfileNamed(file.Name) == null) { ProfileManager.profiles.Add(new Profile(file)); } else { Log.Warning("Tried to add profile named " + file.Name + ", already exists; should not be possible. Ignoring profile."); } }