public static MenuFile ParseMenu(string text) { string[] lines = Utility.SplitIrbisLines(text); MenuFile result = new MenuFile(lines.Length / 2 + 1); for (int i = 0; i < lines.Length; i += 2) { string code = lines[i]; if (code.StartsWith("*****")) { break; } string comment = lines[i + 1]; MenuEntry entry = new MenuEntry(); entry.Code = code; entry.Comment = comment; result.Add(entry); } return(result); }
public MenuFile LoadMenu(string menuName) { return(MenuFile.ParseMenu(ReadTextFile(menuName))); }