Exemplo n.º 1
0
        private void ReadJSON(string path)
        {
            JsonSerializer serializer = new JsonSerializer();

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

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