using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace NetMonitorTray.View { public partial class ViewWindowForm : Form { private Models.Window model; public ViewWindowForm() { InitializeComponent(); this.FormClosed += Controller.Window.FormClosed; listView1.ItemActivate += Controller.Window.NetworkSelected; } public void UpdateForm() { this.BeginInvoke((Action)(() => { this.logBox.Text = "Loaded"; List networks = this.model.Networks; foreach(string network in networks) { ListViewItem item = new ListViewItem(); item.Text = network; item.SubItems.Add(this.model.getNetworkProperty(network, "Name")); listView1.Items.Add(item); } })); } public void SetModel(Models.Window window) { this.model = window; } } }