public ProcesyForm() { InitializeComponent(); watcher = new Watcher() { ListView = listView1 }; watcher.LoadSettings(); backgroundWorker1.RunWorkerAsync(); }
public static void RefreshProcessesListView(ListView listView, Watcher watcher) { listView.Items.Clear(); foreach (ProcessToWatch p in watcher.Processes) { ListViewItem t = new ListViewItem(p.ToString()); t.Text = p.ToString(); t.Name = p.ToString(); listView.Items.Add(t); } }
public Form3(Watcher watcher) : this() { this.watcher = watcher; Utility.RefreshProcessesListView(listView1, watcher); }