public static Preparations Builder(XmlNode item) { Preparations result = new Preparations(); foreach (XmlNode node in item.ChildNodes) { Preparation pItem = Preparation.Factory(node); result.Add(pItem); } return(result); }
public static Recipe Factory(XmlNode item) { string initialName = item["Name"].InnerText; RecipeType initialKind = (RecipeType)Enum.Parse(typeof(RecipeType), item["RecipeKind"].InnerText); Products products = Products.Builder(item["Products"]); Preparations preparations = Preparations.Builder(item["Preparations"]); Recipe result = new Recipe(initialName, initialKind); result.TheProducts = products; result.ThePreparations = preparations; return(result); }
private Recipe(string name, RecipeType kind) : base(name) { this.thePreparations = new Preparations(); this.theProducts = new Products(); this.RecipeKind = kind; }