public static MenuItem Parse(Parser parser, int startindent) { var menuitem = new MenuItem(); if (parser.curr.kw != Parser.RegKeywords.None) { throw parser.GetException("unexpected line in MenuItem"); } menuitem.Description = parser.GetLine(); menuitem.SmallGroup = menuitem.Description; if (parser.curr.indent <= startindent) { return(menuitem); } var ind = parser.curr.indent; while (parser.curr.indent == ind) { switch (parser.curr.kw) { case Parser.RegKeywords.SmallGroup: menuitem.SmallGroup = parser.GetString(menuitem.Description); break; case Parser.RegKeywords.Fee: menuitem.Fee = parser.GetDecimal(); break; case Parser.RegKeywords.Limit: menuitem.Limit = parser.GetNullInt(); break; case Parser.RegKeywords.Time: menuitem.MeetingTime = parser.GetDateTime(); break; default: throw parser.GetException("unexpected line in MenuItem"); } } return(menuitem); }
public static DropdownItem Parse(Parser parser, int startindent) { var i = new DropdownItem(); if (parser.curr.kw != Parser.RegKeywords.None) { throw parser.GetException("unexpected line in Dropdown"); } i.Description = parser.GetLine(); i.SmallGroup = i.Description; if (parser.curr.indent <= startindent) { return(i); } var ind = parser.curr.indent; while (parser.curr.indent == ind) { switch (parser.curr.kw) { case Parser.RegKeywords.SmallGroup: i.SmallGroup = parser.GetString(i.Description); break; case Parser.RegKeywords.Fee: i.Fee = parser.GetDecimal(); break; case Parser.RegKeywords.Limit: i.Limit = parser.GetNullInt(); break; case Parser.RegKeywords.Time: i.MeetingTime = parser.GetDateTime(); break; default: throw parser.GetException("unexpected line in DropdownItem"); } } return(i); }
public static DropdownItem Parse(Parser parser, int startindent) { var i = new DropdownItem(); if (parser.curr.kw != Parser.RegKeywords.None) throw parser.GetException("unexpected line in Dropdown"); i.Description = parser.GetLine(); i.SmallGroup = i.Description; if (parser.curr.indent <= startindent) return i; var ind = parser.curr.indent; while (parser.curr.indent == ind) { switch (parser.curr.kw) { case Parser.RegKeywords.SmallGroup: i.SmallGroup = parser.GetString(i.Description); break; case Parser.RegKeywords.Fee: i.Fee = parser.GetDecimal(); break; case Parser.RegKeywords.Limit: i.Limit = parser.GetNullInt(); break; case Parser.RegKeywords.Time: i.MeetingTime = parser.GetDateTime(); break; default: throw parser.GetException("unexpected line in DropdownItem"); } } return i; }
public static MenuItem Parse(Parser parser, int startindent) { var menuitem = new MenuItem(); if (parser.curr.kw != Parser.RegKeywords.None) throw parser.GetException("unexpected line in MenuItem"); menuitem.Description = parser.GetLine(); menuitem.SmallGroup = menuitem.Description; if (parser.curr.indent <= startindent) return menuitem; var ind = parser.curr.indent; while (parser.curr.indent == ind) { switch (parser.curr.kw) { case Parser.RegKeywords.SmallGroup: menuitem.SmallGroup = parser.GetString(menuitem.Description); break; case Parser.RegKeywords.Fee: menuitem.Fee = parser.GetDecimal(); break; case Parser.RegKeywords.Limit: menuitem.Limit = parser.GetNullInt(); break; case Parser.RegKeywords.Time: menuitem.MeetingTime = parser.GetDateTime(); break; default: throw parser.GetException("unexpected line in MenuItem"); } } return menuitem; }