public void Insert(IPlaylistItem item, int index) { if (index == 0) { Items.AddFirst(item); return; } var temp = Items.First; if (index > 0) { for (int i = 0; i < index; i++) { temp = temp.Next; } Items.AddBefore(temp, item); return; } throw new IndexOutOfRangeException(); }
public void AddBefor(IPlaylistItem replacent, IPlaylistItem item) { Items.AddBefore(Items.Find(replacent), item); }