public static void Init() { Languages = Directory.EnumerateFiles(PathResolver.GetResourceFolder("LyricInputHelper", "lang"), "*.txt", SearchOption.TopDirectoryOnly).Select(n => Path.GetFileNameWithoutExtension(n)).ToArray(); var lang_file = PathResolver.GetResourceFile("LyricInputHelper", "lang", "lang"); if (File.Exists(lang_file)) { string filename = File.ReadAllText(lang_file).Trim(' ', '\n', '\r'); if (Languages.Contains(filename)) { Set(filename); return; } } Set(_default); }