Esempio n. 1
0
        public Boolean WriteEqx(String path, EqxSensors sensors)
        {
            if (string.IsNullOrEmpty(path))
            {
                return(false);
            }
            XmlSerializer serializer = new XmlSerializer(typeof(EqxSensors));
            TextWriter    writer     = new StreamWriter(path);

            serializer.Serialize(writer, sensors);
            writer.Close();
            return(true);
        }
Esempio n. 2
0
        public EqxSensors ReadEqx(String path)
        {
            if (string.IsNullOrEmpty(path))
            {
                return(null);
            }
            XmlSerializer serializer = new XmlSerializer(typeof(EqxSensors));
            StreamReader  reader     = new StreamReader(path);

            reader.ReadToEnd();
            EqxSensors sensors = (EqxSensors)serializer.Deserialize(reader);

            reader.Close();
            return(sensors);
        }