예제 #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);
        }
예제 #2
0
 public AudiobookMetadata() : base()
 {
     Path         = string.Empty;
     MetadataPath = string.Empty;
     Genre        = string.Empty;
     Contributors = new Contributors();
     ReleaseYear  = string.Empty;
 }
예제 #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");
        }
예제 #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);
        }
예제 #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);
        }