public void Next() { if (Songs.Count > 1) { int tmpIndex = -1; while (true) { tmpIndex = random.Next(0, Songs.Count); if (tmpIndex != index) { break; } } if (tmpIndex > 0 && tmpIndex < Songs.Count) { SongsIndexHistory.Push(index); index = tmpIndex; } } else { First(); } }
public void First() { index = 0; SongsIndexHistory.Push(index); }