Example #1
0
        private void ReadJSON(string path)
        {
            JsonSerializer serializer = new JsonSerializer();

            using (JsonReader reader = new JsonTextReader(new StreamReader(path)))
            {
                bookShelf = (BookShelf)serializer.Deserialize(reader);
            }
        }
Example #2
0
        private void ReadXML(string path)
        {
            XmlSerializer xmlSerializer = new XmlSerializer(typeof(BookShelf));

            using (StreamReader sr = new StreamReader(path))
            {
                bookShelf = (BookShelf)xmlSerializer.Deserialize(sr);
            }
        }
Example #3
0
 public BookShelfService(BookShelf bookShelf)
 {
     this.bookShelf = bookShelf;
 }