static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); SerialWindow serialWin = new SerialWindow(); try { //try to open the first serial port when the program starts serialWin.openPortActionFirstTime(); } catch (Exception) { //do nothing } serialWin.Show(); serialWin.updateLayoutHistoryPanel(); //Application.Run(serialWin); ProgramWithContext context = new ProgramWithContext(); Application.Run(context); }
private void openNewInstanceOfSerial() { SerialWindow newInstance = new SerialWindow(); newInstance.Size = this.Size; newInstance.Show(); //try to open a new port newInstance.openPortActionFirstTime(); }