相当于利用反射的 GetValues与GetNames
foreach (HETieXinType theType in Enum.GetValues(typeof(HETieXinType)))
foreach (string mode in Enum.GetNames(typeof(BooleanInteractionMode)))
{
ledResponseModesComboBox.Items.Add(mode);
switchResponseModesComboBox.Items.Add(mode);
}
从字符串变成枚举
(AITerminalConfiguration)Enum.Parse(typeof(AITerminalConfiguration), terminalConfigurationComboBox.SelectedItem.ToString())