Esempio n. 1
0
 private void CleanMemory_Click(object sender, RoutedEventArgs e)
 {
     _temperatures.cleanValues();
     _pressures.cleanValues();
     _vacuums.cleanValues();
     MainWindow_CollectionChanged();
 }
Esempio n. 2
0
        public void ReadFromFile(string path)
        {
            _temperatureRepository.cleanValues();
            _pressureRepository.cleanValues();
            _vacauumRepository.cleanValues();

            using (StreamReader sr = new StreamReader(path))
            {
                String line = sr.ReadLine();
                line = sr.ReadLine();
                while (!string.IsNullOrEmpty(line))
                {
                    var type = line.Substring(1, line.Length - 1).Split('-')[0];
                    switch (type)
                    {
                    case "Temp":
                        line = Readtemp(sr);
                        break;

                    case "Pressao":
                        line = ReadPressure(sr);
                        break;

                    case "Vacuo":
                        line = ReadVacuum(sr);
                        break;

                    default:
                        break;
                    }
                }
            }
        }