private void KeyEventReplace(object sender, ListItemReplaceEventArgs<Id3v2KeyEvent> e)
        {
            if (e == null)
                throw new ArgumentException("e");

            if (e.NewItem == null)
                throw new NullReferenceException("e.NewItem may not be null");

            _keyEvents.RemoveAt(e.Index);
            e.Cancel = true;
            _keyEvents.Add(e.NewItem);
        }
        private void ChannelInformationReplace(object sender, ListItemReplaceEventArgs<Id3v2ChannelInformation> e)
        {
            if (e == null)
                throw new ArgumentNullException("e");

            if (e.NewItem == null)
                throw new NullReferenceException("e.NewItem may not be null");

            _channelInformation.RemoveAt(e.Index);
            e.Cancel = true;
            _channelInformation.Add(e.NewItem);
        }
Example #3
0
        private void FrameReplace(object sender, ListItemReplaceEventArgs<Id3v2Frame> e)
        {
            if (e == null)
                throw new ArgumentNullException("e");

            if (e.NewItem == null)
                throw new NullReferenceException("e.NewItem may not be null");

            if (String.Equals(e.OldItem.Identifier, e.NewItem.Identifier) || (e.OldItem.GetType() == e.NewItem.GetType()))
                return;

            FrameRemove(sender, new ListItemRemoveEventArgs<Id3v2Frame>(e.OldItem));
            FrameAdd(sender, new ListItemAddEventArgs<Id3v2Frame>(e.NewItem));
        }
        private void InvolvedPeopleReplace(object sender, ListItemReplaceEventArgs<Id3v2InvolvedPeople> e)
        {
            if (e == null)
                throw new ArgumentNullException("e");

            if (e.NewItem == null)
                throw new NullReferenceException("e.NewItem may not be null");

            _involvedPeople.RemoveAt(e.Index);
            e.Cancel = true;
            _involvedPeople.Add(e.NewItem);
        }
        private void EqualisationBandReplace(object sender, ListItemReplaceEventArgs<Id3v2EqualisationBand> e)
        {
            if (e == null)
                throw new ArgumentNullException("e");

            if (e.NewItem == null)
                throw new NullReferenceException("e.NewItem may not be null");

            _equalisationBands.RemoveAt(e.Index);
            e.Cancel = true;
            _equalisationBands.Add(e.NewItem);
        }
Example #6
0
        private void ValueReplace(object sender, ListItemReplaceEventArgs<string> e)
        {
            if (e == null)
                throw new ArgumentNullException("e");

            if (e.NewItem == null)
                throw new NullReferenceException("e.NewItem may not be null");

            if (!IsValidTextString(e.NewItem, TextEncoding, false))
                throw new InvalidDataException("value contains one or more invalid characters for the current frame encoding type.");
        }
Example #7
0
        private static void ItemReplace(object sender, ListItemReplaceEventArgs<string> e)
        {
            if (e == null)
                throw new ArgumentNullException("e");

            if (e.NewItem == null)
                throw new NullReferenceException("e.NewItem may not be null");

            if (!Uri.IsWellFormedUriString(e.NewItem, UriKind.RelativeOrAbsolute))
                throw new InvalidDataException("value contains one or more invalid characters for the current frame encoding type.");
        }