private async void ConnectButton_Click(object sender, RoutedEventArgs e) { try { // get selected endpoint. ConfiguredEndpoint endpoint = SelectedEndpoint; if (endpoint == null) { return; } // raise event. if (m_ConnectEndpoint != null) { ConnectEndpointEventArgs args = new ConnectEndpointEventArgs(endpoint, true); await m_ConnectEndpoint(this, args); // save endpoint in drop down. if (args.UpdateControl) { // must update the control because the display text may have changed. Initialize(m_endpoints, m_configuration); SelectedEndpoint = endpoint; } } } catch (Exception exception) { GuiUtils.HandleException(String.Empty, GuiUtils.CallerName(), exception); } }
private void ConnectButton_Click(object sender, EventArgs e) { try { // get selected endpoint. ConfiguredEndpoint endpoint = SelectedEndpoint; if (endpoint == null) { return; } // raise event. if (m_ConnectEndpoint != null) { ConnectEndpointEventArgs args = new ConnectEndpointEventArgs(endpoint, true); m_ConnectEndpoint(this, args); // save endpoint in drop down. if (args.UpdateControl) { // must update the control because the display text may have changed. Initialize(m_endpoints, m_configuration); SelectedEndpoint = endpoint; } } } catch (Exception exception) { GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception); } }
void EndpointsCTRL_ConnectEndpoint(object sender, ConnectEndpointEventArgs e) { try { if (m_running) { throw new InvalidOperationException("Test is already running."); } if (m_testConfiguration.Coverage == 0) { m_testConfiguration.Coverage = 100; } SetRunning(true); EndpointTB.Text = e.Endpoint.EndpointUrl.ToString(); TestsCompletedTB.Text = "---"; IterationTB.Text = "---"; TestCaseTB.Text = "---"; TestCaseProgressCTRL.Value = 0; ResultsTB.Clear(); ThreadPool.QueueUserWorkItem(Run, e.Endpoint); } catch (Exception exception) { GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception); e.UpdateControl = false; } }
async Task EndpointSelectorCTRL_ConnectEndpoint(object sender, ConnectEndpointEventArgs e) { try { // disable Connect while connecting button EndpointSelectorCTRL.IsEnabled = false; // Connect e.UpdateControl = await Connect(e.Endpoint); } catch (Exception exception) { GuiUtils.HandleException(String.Empty, GuiUtils.CallerName(), exception); e.UpdateControl = false; } finally { // enable Connect button EndpointSelectorCTRL.IsEnabled = true; } }
void EndpointSelectorCTRL_ConnectEndpoint(object sender, ConnectEndpointEventArgs e) { try { Connect(e.Endpoint); } catch (Exception exception) { GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception); e.UpdateControl = false; } }
private void EndpointSelectorCTRL_ConnectEndpoint(object sender, ConnectEndpointEventArgs e) { try { // check if a test is already running. lock (m_lock) { if (m_running) { throw new InvalidOperationException("A test is already running."); } } ConfiguredEndpoint endpoint = e.Endpoint; // start processing. OkBTN.Enabled = m_running = true; ThreadPool.QueueUserWorkItem(new WaitCallback(DoTest), endpoint); } catch (Exception exception) { GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception); e.UpdateControl = false; } }
void EndpointSelectorCTRL_ConnectEndpoint(object sender, ConnectEndpointEventArgs e) { try { TestEventsCTRL.Clear(); Connect(e.Endpoint, Test_UseNativeStackMI.Checked, 1024); } catch (Exception exception) { GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception); e.UpdateControl = false; } }