Example #1
0
 public void SetDataReference(RecipeSet RecipeSetData)
 {
     _RecipeSetData = RecipeSetData;
     if (this.Count() != 0)
     {
         this[0].SetDataReference(RecipeSetData);
     }
 }
Example #2
0
        private UnitTranslationSet _UnitTranslations;   //related to Units

        //Constructors
        public AllDataSets()
        {
            _Units             = new UnitSet();
            _UnitTranslations  = new UnitTranslationSet(_Units);
            _Ingredients       = new IngredientSet(_Units);
            _Recipes           = new RecipeSet(_Units, _Ingredients);
            _FoodPlanItems     = new FoodPlanItemSet();
            _ShoppingListItems = new ShoppingListItemSet();
            SetDataReference();
        }
Example #3
0
        public RecipeSet OpenSet(string FileName)
        {
            RecipeSet ReturnSet = this;

            ReturnSet.Clear();
            FileName += FileExtension;
            using (Stream fs = new FileStream(FileName, FileMode.Open))
            {
                System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(ReturnSet.GetType());
                ReturnSet = (RecipeSet)x.Deserialize(fs);
            }
            EvaluateMaxID();
            return(ReturnSet);
        }// --> Data
Example #4
0
        public AllDataSets(bool ToBePopulatedWithDefaults)
        {
            _Units = new UnitSet();

            _UnitTranslations  = new UnitTranslationSet(_Units);
            _Ingredients       = new IngredientSet(_Units);
            _Recipes           = new RecipeSet(_Units, _Ingredients);
            _FoodPlanItems     = new FoodPlanItemSet();
            _ShoppingListItems = new ShoppingListItemSet();
            SetDataReference();
            if (ToBePopulatedWithDefaults)
            {
                PopulateSetWithDefaults();
            }
        }
Example #5
0
 public void SetDataReference(RecipeSet RecipeSetData)
 {
     _RecipeSetData = RecipeSetData;
 }