Exemplo n.º 1
0
        XmlNode get_queue_child_node(string queue_name, QueueNodes node)
        {
            XmlNode xq       = get_queue_node(queue_name);
            string  node_tag = node.ToString();
            XmlNode xi       = xq.SelectSingleNode(node_tag);

            if (xi == null)
            {
                xi = xd.CreateElement(node_tag);
                xq.AppendChild(xi);
            }
            return(xi);
        }
Exemplo n.º 2
0
        private static void Queue()
        {
            QueueNodes <int> queue = new QueueNodes <int>();

            int limitItems;

            Console.WriteLine("Please type the amount of items you might want to create: ");
            limitItems = Convert.ToInt32(Console.ReadLine());

            for (int i = 1; i <= limitItems; i++)
            {
                queue.Enqueue(new Node <int>(i));
            }

            for (int i = 1; i <= limitItems; i++)
            {
                Console.WriteLine(queue.Dequeue().Data);
            }
            Console.WriteLine("fin");
        }