private HopIngredientItem ParseHop(string hopContent) { HopIngredientItem item = new HopIngredientItem(); item.HopIngredientIndex = int.Parse(hopContent.Substring(",", ")")); item.HopValue = int.Parse(ParseSelectedDropdownValue(hopContent)); item.Acid = AsDouble(hopContent.Substring("acid\" onchange=\"calc()\" value=\"", "\"").Replace(".", ",")); item.Weight = int.Parse(hopContent.Substring("hopw\" onchange=\"calc()\" value=\"", "\"")); item.BoilTime = ParseSelectedDropdownValue(hopContent.Substring("boil", "</td>"), true); return(item); }
private List <HopIngredientItem> ParseHops(string content) { List <string> hops = content.Substrings("do_drop('hop'", "</tr>"); List <HopIngredientItem> hopIngredients = new List <HopIngredientItem>(); foreach (string hopContent in hops) { HopIngredientItem item = ParseHop(hopContent); if (item.HopValue != 0) { hopIngredients.Add(item); } } return(hopIngredients); }