我需要将任务调度程序2.0中当前计划的任务填充到WPF中的GridView。我的应用程序当前添加和删除用户安排的任务,但我需要一种方法让他们查看当前的计划任务,而无需转到任务计划程序。
更新
谢谢pax我最终使用此方法并使用.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);
}
}