2 using System.Collections.Generic;
3 using System.ComponentModel;
7 using System.Windows.Forms;
11 public partial class EndpointInputBox : Form
13 public EndpointInputBox()
15 InitializeComponent();
18 private void Warning(string message)
20 MessageBox.Show(this, message, Text, MessageBoxButtons.OK, MessageBoxIcon.Warning);
23 private void chkConnect_CheckedChanged(object sender, EventArgs e)
25 txtHost.Enabled = chkConnect.Checked;
26 txtPort.Enabled = chkConnect.Checked;
29 private void btnOK_Click(object sender, EventArgs e)
31 if (txtInstanceName.Text.Length == 0) {
32 Warning("Please enter an instance name.");
36 if (chkConnect.Checked) {
37 if (txtHost.Text.Length == 0) {
38 Warning("Please enter a host name.");
42 if (txtPort.Text.Length == 0) {
43 Warning("Please enter a port.");
48 DialogResult = DialogResult.OK;