Exemplo n.º 1
0
        public void Shuffle()
        {
            if (!_shuffle)
            {
                // backup and shuffle the _list
                _originalList = _list;

                Random       r      = new Random();
                MediaUrlList ultemp = new MediaUrlList();

                for (int counter = 0; counter < _list.Count; counter++)
                {
                    int newIndex = r.Next(_list.Count);

                    // swap the two elements over
                    MediaUrl url = _list[counter];
                    _list[counter]  = _list[newIndex];
                    _list[newIndex] = url;
                }

                _shuffle = true;
            }
            else
            {
                _list = _originalList;
            }
        }
Exemplo n.º 2
0
 public RandomMediaUrlList()
 {
     _list = new MediaUrlList();
 }