public void ConnectExecuted() { AddressSelector selector = new AddressSelector(); if (selector.ShowDialog() != true) { return; } new Thread(new ThreadStart(delegate() { ConnectThreadProc(selector.Result); })).Start(); }
public async void ConnectExecuted() { AddressSelector selector = new AddressSelector(); if (selector.ShowDialog() != true) { return; } Kill(); if (connectionTask != null) { await connectionTask; } client = selector.Result; stream = client.GetStream(); connectionTask = ConnectionProc(); }