Ejemplo n.º 1
0
        internal override void Parse(XElement element)
        {
            base.Parse(element);

            var userElement = element.Element("user");
            if (userElement != null)
            {
                User = new UserSummary();
                User.Parse(userElement);
            }

            ReadStatuses = element.ParseChildren<ReadStatus>("read_statuses", "read_status");

            var commentsElement = element.Element("comments");
            if (commentsElement != null)
            {
                Comments = new PaginatedList<Comment>();
                Comments.Parse(commentsElement);
            }
        }
Ejemplo n.º 2
0
        internal override void Parse(XElement element)
        {
            Id            = element.ElementAsInt("id");
            Header        = element.ElementAsString("header");
            LikesCount    = element.ElementAsInt("likes_count");
            CommentsCount = element.ElementAsInt("comments_count");
            Liked         = element.ElementAsBool("liked");
            CreatedAt     = element.ElementAsDateTime("created_at");
            UpdatedAt     = element.ElementAsDateTime("updated_at");
            Status        = element.ElementAsString("status");
            ReviewId      = element.ElementAsInt("review_id");

            var book = element.Element("book");

            if (book != null)
            {
                Book = new BookSummary();
                Book.Parse(book);
            }

            var comments = element.Element("comments");

            if (comments != null)
            {
                Comments = new PaginatedList <Comment>();
                Comments.Parse(comments);
            }

            var user = element.Element("user");

            if (user != null)
            {
                User = new Actor();
                User.Parse(user);
            }
        }