Beispiel #1
0
        public virtual T ReadData(string path, bool mustBeBackedUp = false)
        {
            if (mustBeBackedUp)
            {
                FileBackUp.BackUpFile(path);
            }

            T data;

            using (TextReader reader = new StreamReader(path))
            {
                XmlSerializer serializer = new XmlSerializer(typeof(DATA));
                data = (T)serializer.Deserialize(reader);
            }
            return(data);
        }
        public override BaseData ReadData(string path, bool mustBeBackedUp)
        {
            if (mustBeBackedUp)
            {
                FileBackUp.BackUpFile(path);
            }

            DATA data;

            using (TextReader reader = new StreamReader(path))
            {
                XmlSerializer serializer = new XmlSerializer(typeof(DATA));
                data = (DATA)serializer.Deserialize(reader);
            }

            return(data);
        }