static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); DeviceCommandManager.initialCommandList(); List <CommandMatch> cmdList = CommandMatchHelper.importCommand(); DeviceCommandManager.matchCommand(cmdList); serverForm form = new serverForm(); services.showStateForm = form; //frmProtocolTest form = new frmProtocolTest(); Application.Run(form); }
public frmProtocolTest() { InitializeComponent(); pList = CommandMatchHelper.importCommand(); if (pList == null) { pList = new List <CommandMatch>(); } Array array = Enum.GetValues(typeof(enumDeviceCommand)); for (int i = 0; i < array.Length; i++) { CommandMatchHelper.addCommand(pList, new CommandMatch(array.GetValue(i).ToString(), "")); } //CommandMatchHelper.addCommand(pList, new CommandMatch(enumDeviceCommand.检查红灯状态.ToString(), "")); //CommandMatchHelper.addCommand(pList, new CommandMatch(enumDeviceCommand.检查绿灯状态.ToString(), "")); //CommandMatchHelper.addCommand(pList, new CommandMatch(enumDeviceCommand.检查黄灯状态.ToString(), "")); // 。。。 foreach (CommandMatch c in pList) { this.cbCmd.Items.Add(c.name); } initial_udp_server(Program.inputPort); this.FormClosing += frmProtocolTest_FormClosing; this.cbCmd.SelectedIndexChanged += cbCmd_SelectedIndexChanged; if (this.cbCmd.Items.Count > 0) { this.cbCmd.SelectedIndex = 0; } }