public override void AddZuneAttribute(ZuneAttribute zuneAttribute)
        {
            var existingFrame = _tag.OfType<PrivateFrame>()
                .Where(frame => frame.Owner == zuneAttribute.Name).FirstOrDefault();

            if (existingFrame != null)
            {
                _tag.ReplaceFrame(existingFrame, new PrivateFrame(zuneAttribute.Name, zuneAttribute.Guid.ToByteArray()));
            }
            else
            {
                _tag.AddFrame(new PrivateFrame(zuneAttribute.Name, zuneAttribute.Guid.ToByteArray()));
            }
        }
        public override void AddZuneAttribute(ZuneAttribute zuneAttribute)
        {
            var descRecord = new DescriptionRecord(0, 0, zuneAttribute.Name, zuneAttribute.Guid);

            var attrib = _tag.MetadataLibraryObject.Where(x => x.Name == zuneAttribute.Name).FirstOrDefault();

            if (attrib != null)
            {
                _tag.MetadataLibraryObject.SetRecords(0, 0, attrib.Name, descRecord);
            }
            else
            {
                _tag.MetadataLibraryObject.AddRecord(descRecord);
            }
        }
        public override void AddZuneAttribute(ZuneAttribute zuneAttribute)
        {
            var parts = GetParts().ToList();

            var existingPart = parts.OfType<GuidPart>()
                .Where(x => x.Name == zuneAttribute.Name)
                .FirstOrDefault();

            if (existingPart != null)
                parts.Remove(existingPart);

            parts.Add(new GuidPart(zuneAttribute.Name, zuneAttribute.Guid));

            UpdateXtraBox(parts);
        }
        public void Then_it_should_be_able_to_read_out_all_the_zune_data()
        {
            IZuneTagContainer container = ZuneTagContainerFactory.GetContainer(_path);

            IEnumerable <ZuneAttribute> ids = container.ReadZuneAttributes().ToList();

            Assert.That(ids.Count(), Is.EqualTo(3));

            var mediaID            = new ZuneAttribute(ZuneIds.Track, new Guid("29c29901-0100-11db-89ca-0019b92a3933"));
            var albumArtistMediaID = new ZuneAttribute(ZuneIds.Artist,
                                                       new Guid("760f0800-0600-11db-89ca-0019b92a3933"));

            var albumMediaID = new ZuneAttribute(ZuneIds.Album,
                                                 new Guid("25c29901-0100-11db-89ca-0019b92a3933"));

            Assert.That(ids.Contains(mediaID));
            Assert.That(ids.Contains(albumArtistMediaID));
            Assert.That(ids.Contains(albumMediaID));
        }
        public void AddZuneAttribute(ZuneAttribute zuneAttribute)
        {
            RemoveZuneAttribute(zuneAttribute.Name);

            _container.Add(new PrivateFrame(zuneAttribute.Name, zuneAttribute.Guid.ToByteArray()));
        }
示例#6
0
        public void AddZuneAttribute(ZuneAttribute zuneAttribute)
        {
            RemoveZuneAttribute(zuneAttribute.Name);

            _container.Add(new Attribute(zuneAttribute.Name, zuneAttribute.Guid.ToString(), WMT_ATTR_DATATYPE.WMT_TYPE_GUID));
        }
        public void AddZuneAttribute(ZuneAttribute zuneAttribute)
        {
            RemoveZuneAttribute(zuneAttribute.Name);

            _container.Add(new PrivateFrame(zuneAttribute.Name,zuneAttribute.Guid.ToByteArray()));
        }
        public void AddZuneAttribute(ZuneAttribute zuneAttribute)
        {
            RemoveZuneAttribute(zuneAttribute.Name);

            _container.Add(new Attribute(zuneAttribute.Name, zuneAttribute.Guid.ToString(), WMT_ATTR_DATATYPE.WMT_TYPE_GUID));
        }