private void OnDisconnect() { if (this.InvokeRequired) { this.Invoke(new Action(() => { OnDisconnect(); })); return; } ConnectButton.Text = "Connect"; ConnectButton.Enabled = true; IpcDisconnectedPanel.Hide(); DisconnectedPanel.Show(); ConnectedPanel.Hide(); }
private void OnConnect() { if (this.InvokeRequired) { this.Invoke(new Action(() => { OnConnect(); })); return; } IpcDisconnectedPanel.Hide(); ConnectedPanel.Show(); DisconnectedPanel.Hide(); }
private void ClientForm_Load(object sender, EventArgs e) { this.MaximizeBox = false; SetIpcStatusLabelText("Checking if service is\nrunning..."); if (!IsProcessRunning()) { MessageBox.Show("Error: Inputshareservice is not running. exiting"); Exit(); return; } SetIpcStatusLabelText("Connecting to IPC..."); DisconnectedPanel.Hide(); IpcDisconnectedPanel.Show(); IpcDisconnectedPanel.BringToFront(); ConnectedPanel.Visible = false; Task.Run(new Action(() => { IpcConnect(); })); ClientNameTextBox.Text = Environment.MachineName; }