Beispiel #1
0
        /// <summary>
        /// loads all the recipes if there is a file
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void BtnLoad_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog     = new OpenFileDialog();
            OpenFileDialog openFileDialog1    = new OpenFileDialog();
            string         recipeFilePath     = null;
            string         ingredientFilePath = null;

            if (openFileDialog.ShowDialog().Value)
            {
                recipeFilePath = openFileDialog.FileName;
                if (openFileDialog1.ShowDialog().Value)
                {
                    ingredientFilePath = openFileDialog1.FileName;
                }
                recipeBook.Load(recipeFilePath, ingredientFilePath);
            }
            foreach (var r in recipeBook.recipeList)
            {
                recipes.Add(r);
            }
            ListBoxReset();
        }
Beispiel #2
0
 public void LoadTest1()
 {
     Assert.IsFalse(recipeBook.Load(@"sss.txt", @"qqq.txt"));
 }