コード例 #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);
 }