Пример #1
0
 public void movedown(int pos)
 {
     if (pos < playlist.Count - 1)
     {
         PLItem a      = playlist.ElementAt(GetIndexByPosition(pos));
         PLItem b      = playlist.ElementAt(GetIndexByPosition(pos + 1));
         int    holder = a.position;
         a.position = b.position;
         b.position = holder;
         playlist.Sort(comparebypos);
     }
 }
Пример #2
0
 private static int comparebypos(PLItem a, PLItem b)
 {
     if (b.position > a.position)
     {
         return(-1);
     }
     else if (a.position > b.position)
     {
         return(1);
     }
     else
     {
         return(0);
     }
 }
Пример #3
0
 public void addItem(PLItem item)
 {
     item.position = playlist.Count;
     playlist.Add(item);
 }
Пример #4
0
 private bool matchespos(PLItem p)
 {
     return(p.position == needle);
 }