Пример #1
0
        public XElement ToXML()
        {
            var xPublishInfo = new XElement(Fb2Const.fb2DefaultNamespace + PublishInfoElementName);

            if (BookTitle != null)
            {
                xPublishInfo.Add(BookTitle.ToXML(BookNameElementName));
            }
            if (Publisher != null)
            {
                xPublishInfo.Add(Publisher.ToXML(PublisherElementName));
            }
            if (City != null)
            {
                xPublishInfo.Add(City.ToXML(CityElementName));
            }
            if (Year != null)
            {
                xPublishInfo.Add(new XElement(Fb2Const.fb2DefaultNamespace + YearElementName, Year.ToString()));
            }
            if (ISBN != null)
            {
                xPublishInfo.Add(ISBN.ToXML(ISBNElementName));
            }
            foreach (SequenceType sec in ItemSequences)
            {
                xPublishInfo.Add(sec.ToXML());
            }

            return xPublishInfo;
        }