示例#1
0
        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);
        }
示例#2
0
 public MenuFile LoadMenu(string menuName)
 {
     return(MenuFile.ParseMenu(ReadTextFile(menuName)));
 }