| | |
| | | { |
| | | cmbType.Items.Add(communicator.CommunicatorConnections["型号"]?.ToString()); |
| | | } |
| | | cmbVarType.Items.Clear(); |
| | | if (!string.IsNullOrEmpty(communicator.CommunicatorConnections["变量类型"]?.ToString())) |
| | | { |
| | | cmbVarType.Items.Add(communicator.CommunicatorConnections["变量类型"]?.ToString()); |
| | | } |
| | | } |
| | | |
| | | public CommunicatorForm(BaseCommunicator communicator, string name) |
| | |
| | | |
| | | private void cmbVarType_SelectedIndexChanged(object sender, EventArgs e) |
| | | { |
| | | if (communicator != null && !communicator.CommunicatorConnections.Contains("变量类型")) |
| | | { |
| | | communicator.CommunicatorConnections.Add("变量类型", cmbVarType.Text); |
| | | } |
| | | else if (communicator != null) |
| | | { |
| | | communicator.CommunicatorConnections["变量类型"] = cmbVarType.Text; |
| | | communicatorChanged(communicator); |
| | | } |
| | | //if (communicator != null && !communicator.CommunicatorConnections.Contains("变量类型")) |
| | | //{ |
| | | // communicator.CommunicatorConnections.Add("变量类型", cmbVarType.Text); |
| | | //} |
| | | //else if (communicator != null) |
| | | //{ |
| | | // communicator.CommunicatorConnections["变量类型"] = cmbVarType.Text; |
| | | // communicatorChanged(communicator); |
| | | //} |
| | | } |
| | | } |
| | | } |