/// <summary> /// Saving to a text file what is in a Item list /// </summary> private void SaveItems() { StreamWriter sw = null; try { sw = new StreamWriter(FILENAME); foreach (Item Item in Items) { sw.WriteLine(ItemMapper.ToStringCsv(Item)); sw.Flush(); } } catch (Exception e) { Console.WriteLine("Something went wrong"); } finally { if (sw != null) { sw.Close(); } } }