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()); } }
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()); } }