private async void CheckServers() { UpdateServersStripMenuItem.Enabled = false; ComboBoxRow[] rows = new ComboBoxRow[localIPCoboBox.Items.Count]; localIPCoboBox.Items.CopyTo(rows, 0); foreach (ComboBoxRow item in rows) { string[] temp = item.ToString().Split(':'); item.isAvailable = await Task.Factory.StartNew <bool>( () => SynchronousClient.CheckServer(temp[0], Convert.ToInt32(temp[1])), TaskCreationOptions.LongRunning); } UpdateServersStripMenuItem.Enabled = true; }
public ScreenViewer(int quality, string serverip, int serverport = 11000, int updateTimeout = 0) { InitializeComponent(); client = new SynchronousClient(); client.StartClient(screenPictureBox, quality, serverip, serverport, updateTimeout); }