Пример #1
0
        public void Save(String path, TypeFile typeFile)
        {
            switch (typeFile)
            {
            case TypeFile.txt:
                TextSerializerDB st = new TextSerializerDB(path);
                st.Save(students);
                break;

            case TypeFile.xml:
                XMLSerializerDB xml = new XMLSerializerDB(path);
                xml.Save(students);
                break;

            case TypeFile.json:
                JSONSerializerDB js = new JSONSerializerDB(path);
                js.Save(students);
                break;
            }
        }
Пример #2
0
        public void Load(String path, TypeFile typeFile)
        {
            switch (typeFile)
            {
            case TypeFile.txt:
                TextSerializerDB st = new TextSerializerDB(path);
                students   = st.Load();
                curStudent = students.Count - 1;
                break;

            case TypeFile.xml:
                XMLSerializerDB xml = new XMLSerializerDB(path);
                students   = xml.Load();
                curStudent = students.Count - 1;
                break;

            case TypeFile.json:
                JSONSerializerDB js = new JSONSerializerDB(path);
                students   = js.Load();
                curStudent = students.Count - 1;
                break;
            }
        }