Exemplo n.º 1
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();
        }
Exemplo n.º 2
0
        public FoodPlanItemSet OpenSet(string FileName)
        {
            FoodPlanItemSet ReturnUnitSet = this;

            ReturnUnitSet.Clear();
            FileName += FileExtension;
            using (Stream fs = new FileStream(FileName, FileMode.Open))
            {
                System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(ReturnUnitSet.GetType());
                ReturnUnitSet = (FoodPlanItemSet)x.Deserialize(fs);
            }

            EvaluateMaxID();
            return(ReturnUnitSet);
        }// --> Data
Exemplo n.º 3
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();
            }
        }