Ejemplo n.º 1
0
        public override void RunApp()
        {
            _output = new ConsoleWritter();

            var task1 = new Task(true, "first task", DateTime.Now, DateTime.MaxValue);

            var task2 = new Task(false, "Second task", DateTime.Now, DateTime.Now.Add(new TimeSpan(0, 15, 0)));

            var list = new ListTask(new List<Task>());
            list.AddTask(task1);
            list.AddTask(task2);

            _output.WriteLine("List task///");
            var iteratorlist = list.GetIterator();
            while (iteratorlist.HasNext())
            {
                _output.WriteLine(iteratorlist.Next().ToString());
            }

            _output.WriteLine("Array task///");

            var task = new ArrayTask(new[]{task1,task2}, 0);
            iteratorlist = task.ArrayIterator();
            while (iteratorlist.HasNext())
            {
                _output.WriteLine(iteratorlist.Next().ToString());
            }
        }
Ejemplo n.º 2
0
 public ArrayIterator(Task[] task)
 {
     _task = task;
     _count = 0;
 }
Ejemplo n.º 3
0
 public void AddTask(Task task)
 {
     _count++;
     _tasks[_count]= task;
 }
Ejemplo n.º 4
0
 public ArrayTask(Task[] tasks, int startcount)
 {
     _tasks = tasks;
     _count = startcount;
 }