1

I need to populate the currently scheduled tasks in task scheduler 2.0 to a GridView in WPF. My application currently adds and deletes tasks scheduled by the user but I need a way for them to view the current scheduled tasks without having to go to the task scheduler.

UPDATE

Thanks pax I ended up using this method and tying the column info using the .xaml

    private void PopulateGridView()
    {
        //initialize task scheduler 2.0
        var scheduler = new TaskScheduler.TaskScheduler();
        //connect using server, username, password, and domain
        scheduler.Connect(null, null, null, null);

        //set folder to register tasks; "\\" = local directory
        ITaskFolder rootGet = scheduler.GetFolder("\\");

        //for each task in the folder delete the task
        foreach (IRegisteredTask irTasks in rootGet.GetTasks(0))
        {
            dgInstanceView.ItemsSource = rootGet.GetTasks(0);
        }
     }
jes9582
  • 253
  • 4
  • 15
  • http://stackoverflow.com/questions/1551537/is-there-a-way-to-tell-which-tasks-are-currently-running-in-task-parallel-library/3624409 – decyclone Dec 14 '10 at 13:22

1 Answers1

1

I'd suggest using the GetTasks method of the ITaskFolder interface.

Paxenos
  • 2,756
  • 4
  • 21
  • 20
  • Thanks pax worked great. I ended up using this method and then tying the column information using .xaml – jes9582 Dec 14 '10 at 13:47