public new XElement ToXML()
        {
            XElement metadataXML = base.ToXML();

            if (!string.IsNullOrEmpty(Path))
            {
                metadataXML.Add(new XElement("Path", Path));
            }

            if (!string.IsNullOrEmpty(Genre))
            {
                metadataXML.Add(new XElement("Genre", Genre));
            }

            if (Contributors != null)
            {
                XElement contributorsXML = Contributors.ToXML();
                if (contributorsXML != null)
                {
                    metadataXML.Add(contributorsXML);
                }
            }

            if (!string.IsNullOrEmpty(ReleaseYear))
            {
                metadataXML.Add(new XElement("ReleaseYear", ReleaseYear));
            }

            if (!CoverPath.Equals(StandardCover))
            {
                metadataXML.Add(new XElement("Cover", CoverPath));
            }

            return(metadataXML);
        }
 public AudiobookMetadata() : base()
 {
     Path         = string.Empty;
     MetadataPath = string.Empty;
     Genre        = string.Empty;
     Contributors = new Contributors();
     ReleaseYear  = string.Empty;
 }
        public new void FromXML(XElement xmlElement)
        {
            base.FromXML(xmlElement);

            Path  = XMLHelper.GetSingleValue(xmlElement, "Path");
            Genre = XMLHelper.GetSingleValue(xmlElement, "Genre");

            Contributors.FromXML(xmlElement);

            ReleaseYear = XMLHelper.GetSingleValue(xmlElement, "ReleaseYear");
        }
        public override object Clone()
        {
            AudiobookMetadata copy = new AudiobookMetadata();

            copy.Title        = Title;
            copy.Description  = Description;
            copy.Genre        = Genre;
            copy.Path         = Path;
            copy.MetadataPath = MetadataPath;
            copy.ReleaseYear  = ReleaseYear;
            copy.Contributors = (Contributors)Contributors.Clone();

            return(copy);
        }
Example #5
0
        public object Clone()
        {
            Contributors copy = new Contributors();

            List <string> authorCopy = new List <string>();

            foreach (string author in Authors)
            {
                authorCopy.Add(author);
            }
            copy.Authors = authorCopy;

            List <string> readersCopy = new List <string>();

            foreach (string reader in Readers)
            {
                readersCopy.Add(reader);
            }
            copy.Readers = readersCopy;

            return(copy);
        }