Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public AudiobookMetadata() : base()
 {
     Path         = string.Empty;
     MetadataPath = string.Empty;
     Genre        = string.Empty;
     Contributors = new Contributors();
     ReleaseYear  = string.Empty;
 }
Exemplo n.º 3
0
        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");
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 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);
        }