private void Watcher_Changed(object sender, Microsoft.Win32.TaskScheduler.TaskEventArgs e) { if (listView1.InvokeRequired) { listView1.BeginInvoke(new EventHandler <Microsoft.Win32.TaskScheduler.TaskEventArgs>(Watcher_Changed), sender, e); } else { listView1.Items.Add(new ListViewItem(new string[] { e.TaskPath, e.TaskEvent.StandardEventId.ToString(), e.TaskEvent.ToString() })); } }
private void taskEventWatcher_EventRecorded(object sender, Microsoft.Win32.TaskScheduler.TaskEventArgs e) { outputList.Items.Insert(0, $"{e?.TaskEvent?.EventId}: {e?.TaskEvent}"); }