private void onPingLoop_loadingUp(object sender, EventArgs e) { PingLoop ping = (PingLoop)sender; Invoke((endDelegate)show, sender); Invoke((updateProgressBarDelegate)updateProgressBar, ping.progressPercentage); }
private void buttonStart_Click(object sender, EventArgs e) { if (buttonStart.Text != "Stop") { request = new PingLoop(inputAdresse.Text, int.Parse(inputTime.Text)); int.Parse(inputLatency.Text); request.defineQuery(int.Parse(inputBuffer.Text), int.Parse(inputLatency.Text)); request.endRunEvent += onPingLoop_endRun; request.loadingUpEvent += onPingLoop_loadingUp; progressBar.Visible = true; progressBar.Value = 0; buttonStart.Text = "Stop"; chartGestion.init(0); thread = new Thread(new ThreadStart(request.run)); thread.Start(); } else { request.stop(); buttonStart.Text = "Stopping"; buttonStart.Enabled = false; } }
private void end(object sender) { PingLoop ping = (PingLoop)sender; progressBar.Visible = false; chartGestion.update(0, ping.logPing); buttonStart.Text = "Start"; buttonStart.Enabled = true; }
private void show(object sender) { PingLoop ping = (PingLoop)sender; chartGestion.update(0, ping.logPing); }