mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-09-10 17:15:43 +00:00
Update host C# applications for VS2010. Make LEDNotifier project host applications only display valid COM port names for the PC it is run on, rather than all possible port names. Add missing property files to the TempDataLogger project host application.
This commit is contained in:
@@ -23,8 +23,10 @@ namespace TestWinForms
|
||||
Messenger = new MessengerAPI.Messenger();
|
||||
AppRegKey = Registry.CurrentUser.CreateSubKey("Software\\MailNotifier");
|
||||
|
||||
for (int i = 1; i < 99; i++)
|
||||
cmbComPort.Items.Add("COM" + i.ToString());
|
||||
String[] PortNames = System.IO.Ports.SerialPort.GetPortNames();
|
||||
Array.Sort<String>(PortNames, delegate(string strA, string strB) { return int.Parse(strA.Substring(3)).CompareTo(int.Parse(strB.Substring(3))); });
|
||||
cmbComPort.Items.Clear();
|
||||
cmbComPort.Items.AddRange(PortNames);
|
||||
|
||||
cmbComPort.SelectedIndex = System.Convert.ToInt32(AppRegKey.GetValue("Port", "1")) - 1;
|
||||
serSerialPort.PortName = cmbComPort.Text;
|
||||
|
||||
Reference in New Issue
Block a user