Esempio n. 1
0
        public AllItems GetAllItems()
        {
            var fileName = Path.Combine(appData.Path, "allItems.xml");

            try
            {
                return(AllItems.Read(new FileStream(fileName, FileMode.Open)));
            }
            catch (Exception ex)
            {
                if (File.Exists(fileName))
                {
                    File.Delete(fileName);
                }

                Console.WriteLine(ex);
                return(new AllItems());
            }
        }
Esempio n. 2
0
        public AllItems GetAllItems()
        {
            var fileName = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "allItems.xml");

            try
            {
                return(AllItems.Read(new FileStream(fileName, FileMode.Open)));
            }
            catch (Exception ex)
            {
                if (File.Exists(fileName))
                {
                    File.Delete(fileName);
                }

                Console.WriteLine(ex);
                return(new AllItems());
            }
        }