Exemplo n.º 1
0
        public PropertySynchronizer(EditID3v1Tag v1Tag, EditID3v2Tag v2Tag, string v1TagPropertyName, params string[] v2TagFrameIds)
        {
            this.v1Tag             = v1Tag;
            this.v2Tag             = v2Tag;
            this.v1TagPropertyName = v1TagPropertyName;
            this.v2TagFrameIds     = v2TagFrameIds;

            v1Tag.PropertyChanged   += V1Tag_PropertyChanged;
            v2Tag.CollectionChanged += V2Tag_CollectionChanged;

            foreach (EditTextFrame frame in v2Tag.GetTextFrames())
            {
                if (v2TagFrameIds.Contains(frame.FrameId))
                {
                    frame.PropertyChanged += Frame_PropertyChanged;
                }
            }

            SetValue();
        }
Exemplo n.º 2
0
        public void Reload()
        {
            parent = new ID3File(source);

            if (parent.ID3v1Tag == null)
            {
                parent.ID3v1Tag = new ID3v1Tag();
            }
            if (parent.ID3v2Tag == null)
            {
                parent.ID3v2Tag = new ID3v2Tag();
            }

            V1Tag = new EditID3v1Tag(parent.ID3v1Tag);
            V2Tag = new EditID3v2Tag(parent.ID3v2Tag);

            Title       = new PropertySynchronizer(V1Tag, V2Tag, nameof(V1Tag.Title), FrameFactory.TitleFrameId);
            Artist      = new PropertySynchronizer(V1Tag, V2Tag, nameof(V1Tag.Artist), FrameFactory.LeadArtistFrameId, FrameFactory.BandFrameId);
            Album       = new PropertySynchronizer(V1Tag, V2Tag, nameof(V1Tag.Album), FrameFactory.AlbumFrameId);
            TrackNumber = new PropertySynchronizer(V1Tag, V2Tag, nameof(V1Tag.TrackNumber), FrameFactory.TrackNumberFrameId);
            Year        = new PropertySynchronizer(V1Tag, V2Tag, nameof(V1Tag.Year), FrameFactory.YearFrameId);

            FileName = new FileNameSynchronizer(this);
        }