private void UpdateServerList(Api.Next done = null) { serverView.Items.Clear(); ListStorage.Clear(); Api.Sorted.ServerList.ServersToItems( (success, value) => Invoke((MethodInvoker) (() => { var item = (ListViewItem) (value); if (serverView.Groups[item.SubItems[1].Text] == null) { item.Group = new ListViewGroup(item.SubItems[1].Text, item.SubItems[1].Text); serverView.Groups.Add(item.Group); } else item.Group = serverView.Groups[item.SubItems[1].Text]; serverView.Items.Add(item); ListStorage.Add(item); //Add server to portforward page comboBox1.Items.Add(item.Text + " - " + item.SubItems[3].Text); })), done); }
private void LoadPortList(Api.Next done = null) { listView1.Items.Clear(); ListStorage.Clear(); Api.Sorted.ServerList.loadPorts( (success, value) => Invoke((MethodInvoker) (() => { var item = (ListViewItem)(value); listView1.Items.Add(item); ListStorage.Add(item); })), done); }