Exemple #1
0
        public static void MainProgram()
        {
            var collection = new QueueCollection();

            collection[0] = new QueueItem(1, "Me", "@gost");
            collection[1] = new QueueItem(2, "Vlad", "@symon");
            collection[2] = new QueueItem(3, "Tolyan", "@tolik");
            collection[3] = new QueueItem(4, "Semenov", "@kek");

            QueueIterator iterator = (QueueIterator)collection.GetIterator();

            iterator.Step = 1;

            for (var item = iterator.First();
                 !iterator.IsDone; item = iterator.Next())
            {
                Console.WriteLine($"{item.Position}.{item.FullName}({item.UserName})");
            }
        }
Exemple #2
0
 public QueueIterator(QueueCollection items)
 {
     this._queue = items;
 }