FileFind.Meshwork.GtkClient.Windows.PreferencesDialog.on_redetectConnectionButton_clicked C# (CSharp) Method

on_redetectConnectionButton_clicked() private method

private on_redetectConnectionButton_clicked ( object o, EventArgs args ) : void
o object
args System.EventArgs
return void
        private void on_redetectConnectionButton_clicked(object o, EventArgs args)
        {
            // This button acts as if all other buttons were clicked.
            base.Dialog.GdkWindow.Cursor = new Gdk.Cursor(Gdk.CursorType.Watch);
            Button button = (Button)o;
            button.Sensitive = false;
            ThreadPool.QueueUserWorkItem(delegate {
                string publicIP = DetectPublicIP();
                bool portOpen = TestTCPPort();
                Application.Invoke(delegate {
                    nodePortOpenCheckButton.Active = portOpen;
                    externalIPv4AddressEntry.Text = publicIP;
                    button.Sensitive = true;
                    base.Dialog.GdkWindow.Cursor = new Gdk.Cursor(Gdk.CursorType.LeftPtr);
                });
            });
        }