WingMan – Diff between revs 2 and 3
?pathlinks?
Rev 2 | Rev 3 | |||
---|---|---|---|---|
Line 50... | Line 50... | |||
50 | { |
50 | { |
|
51 | await StopServer(); |
51 | await StopServer(); |
|
52 | toolStripStatusLabel.Text = Properties.Strings.Server_stopped; |
52 | toolStripStatusLabel.Text = Properties.Strings.Server_stopped; |
|
53 | HostButton.BackColor = Color.Empty; |
53 | HostButton.BackColor = Color.Empty; |
|
Line -... | Line 54... | |||
- | 54 | |
||
54 | |
55 | // Enable controls. |
|
- | 56 | ConnectButton.Enabled = true; |
||
55 | ConnectButton.Enabled = true; |
57 | EnableConnectionControls(); |
|
56 | return; |
58 | return; |
|
Line 57... | Line 59... | |||
57 | } |
59 | } |
|
58 | |
60 | |
|
Line 62... | Line 64... | |||
62 | // Start the MQTT server. |
64 | // Start the MQTT server. |
|
63 | await StartServer(ipAddress, port, nick); |
65 | await StartServer(ipAddress, port, nick); |
|
64 | toolStripStatusLabel.Text = Properties.Strings.Server_started; |
66 | toolStripStatusLabel.Text = Properties.Strings.Server_started; |
|
65 | HostButton.BackColor = Color.Aquamarine; |
67 | HostButton.BackColor = Color.Aquamarine; |
|
Line -... | Line 68... | |||
- | 68 | |
||
66 | |
69 | // Disable controls |
|
- | 70 | ConnectButton.Enabled = false; |
||
- | 71 | DisableConnectionControls(); |
||
- | 72 | } |
||
- | 73 | |
||
- | 74 | private void DisableConnectionControls() |
||
- | 75 | { |
||
- | 76 | Address.Enabled = false; |
||
- | 77 | Port.Enabled = false; |
||
- | 78 | Nick.Enabled = false; |
||
- | 79 | } |
||
- | 80 | |
||
- | 81 | private void EnableConnectionControls() |
||
- | 82 | { |
||
- | 83 | Address.Enabled = true; |
||
- | 84 | Port.Enabled = true; |
||
67 | ConnectButton.Enabled = false; |
85 | Nick.Enabled = true; |
|
Line 68... | Line 86... | |||
68 | } |
86 | } |
|
69 | |
87 | |
|
70 | private bool ValidateAddressPort(out IPAddress address, out int port, out string nick) |
88 | private bool ValidateAddressPort(out IPAddress address, out int port, out string nick) |
|
Line 144... | Line 162... | |||
144 | { |
162 | { |
|
145 | await StopClient(); |
163 | await StopClient(); |
|
146 | ConnectButton.Text = Properties.Strings.Connect; |
164 | ConnectButton.Text = Properties.Strings.Connect; |
|
147 | ConnectButton.BackColor = Color.Empty; |
165 | ConnectButton.BackColor = Color.Empty; |
|
Line -... | Line 166... | |||
- | 166 | |
||
148 | |
167 | EnableConnectionControls(); |
|
149 | HostButton.Enabled = true; |
168 | HostButton.Enabled = true; |
|
150 | return; |
169 | return; |
|
Line 151... | Line 170... | |||
151 | } |
170 | } |
|
Line 158... | Line 177... | |||
158 | toolStripStatusLabel.Text = Properties.Strings.Client_started; |
177 | toolStripStatusLabel.Text = Properties.Strings.Client_started; |
|
159 | ConnectButton.Text = Properties.Strings.Disconnect; |
178 | ConnectButton.Text = Properties.Strings.Disconnect; |
|
160 | ConnectButton.BackColor = Color.Aquamarine; |
179 | ConnectButton.BackColor = Color.Aquamarine; |
|
Line 161... | Line 180... | |||
161 | |
180 | |
|
- | 181 | HostButton.Enabled = false; |
||
162 | HostButton.Enabled = false; |
182 | DisableConnectionControls(); |
|
Line 163... | Line 183... | |||
163 | } |
183 | } |
|
164 | |
184 | |
|
165 | private async Task StopClient() |
185 | private async Task StopClient() |