예제 #1
0
        private void _tracert_Done(object sender, EventArgs e)
        {
            SynchronizationContextWrapper.SynchronizationContext.Send(delegate {
                if (LastStatus == IPStatus.Success)
                {
                    btnStatus.Text      = "Success...";
                    btnStatus.BackColor = Color.LightGreen;
                }
                else
                {
                    btnStatus.Text      = "Failed...";
                    btnStatus.BackColor = Color.Orange;
                }
                btnTraceRoute.Enabled = true;

                _tracert.Dispose();
                _tracert = null;

                _tracertDialog.SetCompleted();

                if (Done != null)
                {
                    Done(this, null);
                }
            }, null);
        }
예제 #2
0
        private void Trace()
        {
            kvpHops.Key          = "0 hops";
            kvpRoundtripTime.Key = "? roundtrip time";
            btnStatus.Text       = "Tracing...";
            btnStatus.BackColor  = Color.LightBlue;

            _tracert       = new Tracert();
            _tracert.Hop  += _tracert_Hop;
            _tracert.Done += _tracert_Done;

            _tracert.Trace(HostNameOrIP, MaxHops, Timeout);
        }
예제 #3
0
        private void _tracertDialog_CancelTraceRoute(object sender, EventArgs e)
        {
            btnStatus.Text        = "Idle";
            btnStatus.BackColor   = Color.Transparent;
            btnTraceRoute.Enabled = true;

            _tracert.Dispose();
            _tracert = null;

            if (Done != null)
            {
                Done(this, null);
            }
        }