示例#1
0
        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();
            }
        }
示例#2
0
 public void First()
 {
     index = 0;
     SongsIndexHistory.Push(index);
 }