예제 #1
0
        public ProgramManager(string UserFileSave, string UserFridgeFileSave, string RecipieDatabase, string FoodItemsDatabase, string RecipeSaveFile, string StatisticsSavePath, string ShoppingListSave)
        {
            UserFile = UserFileSave;

            UserFridgeFile = UserFridgeFileSave;

            RecipeSaverSaveFile  = RecipeSaveFile;
            StatisticsSaveFile   = StatisticsSavePath;
            ShoppingListSaveFile = ShoppingListSave;

            User = new UserTemplate(this);
            User = GetUser();
            User.CurrentManager = this;

            UserShoppingList      = new ShoppingList();
            UserShoppingList      = GetShoppingList();
            User.UserShoppingList = UserShoppingList;

            InitFridge(User);

            FoodItemsFile = FoodItemsDatabase;
            RecipiesFile  = RecipieDatabase;

            FoodManag = new FoodManager(FoodItemsFile);

            UserRecipeSaves = new RecipeSaver(RecipeSaverSaveFile);

            UserRecipeSaves = GetRecipeSaver();
            UserRecipeSaves.SaveLocation = RecipeSaverSaveFile;
            UserRecipeSaves.SaveRecipeSaver();

            StatManager = new StatisticsManager(StatisticsSaveFile)
            {
                SaveLocation = StatisticsSaveFile
            };
            StatManager.SaveStatistics();

            RecipieManag = new RecipeManager(RecipiesFile, this);
        }
예제 #2
0
 /// <summary>
 /// Creates a new FridgeTemplate instance and assigns it to the UserTemplate instance frige.
 /// The "FridgeTemplate" class handles its own serialization/deserialization.
 /// </summary>
 /// <param name="UserToUse"></param>
 public void InitFridge(UserTemplate UserToUse)
 {
     UsersFridge          = new FridgeTemplate(UserFridgeFile);
     UserToUse.UserFridge = UsersFridge;
 }