Esempio n. 1
0
        private async Task SaveToFile()
        {
            List <MachineToTest> toSaveList = ListeDesMachines.ToList <MachineToTest>();

            string output = JsonConvert.SerializeObject(toSaveList);

            File.WriteAllText(PathSaveFile, output);
        }
Esempio n. 2
0
 internal async Task DeleteMachine(MachineToTestDisplay selected)
 {
     try
     {
         ListeDesMachines.Remove(selected);
         await SaveToFile();
     }
     catch (Exception ex)
     {
         LogErreur(ex);
         Notify.ShowNotification("Erreur", "Erreur ajouté au fichier log", System.Windows.Forms.ToolTipIcon.Error);
     }
 }
Esempio n. 3
0
        internal async Task AddMachine(string machine, string description)
        {
            try
            {
                MachineToTestDisplay nouvelleMachine = new MachineToTestDisplay(machine, description);
                ListeDesMachines.Add(nouvelleMachine);

                await SaveToFile();
            }
            catch (Exception ex)
            {
                LogErreur(ex);
                Notify.ShowNotification("Erreur", "Erreur ajouté au fichier log", System.Windows.Forms.ToolTipIcon.Error);
            }
        }