예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 private Recipe(string name, RecipeType kind) : base(name)
 {
     this.thePreparations = new Preparations();
     this.theProducts     = new Products();
     this.RecipeKind      = kind;
 }