/// <summary> /// Initializes a new instance of the <see cref="FlashMulti"/> class. /// </summary> public FlashMulti() { this.InitializeComponent(); // Include the version in the window title this.Text = string.Format("Flash Multi v{0}", Application.ProductVersion); // Set focus away from the textbox this.ActiveControl = this.linkLabel2; // Populate the list of serial ports this.PopulateComPorts(); // Disable the Upload button until we're ready this.buttonUpload.Enabled = false; // Register a handler to check for a new version when the form is shown the first time this.Shown += this.FlashMulti_Shown; // Register a handler to run on loading the form this.Load += this.FlashMulti_Load; // Register a handler to be notified when USB devices are added or removed UsbNotification.RegisterUsbDeviceNotification(this.Handle); }
/// <summary> /// Initializes a new instance of the <see cref="SerialMonitor"/> class. /// </summary> /// <param name="serialPortName">The name of the serial port to monitor.</param> public SerialMonitor(string serialPortName) { this.InitializeComponent(); // Register a handler to run on loading the form this.Load += this.SerialMonitor_Load; // Register a handler to be notified when USB devices are added or removed UsbNotification.RegisterUsbDeviceNotification(this.Handle); this.Text = $"Flash Multi Serial Monitor - {this.SerialPortName} (Disconnected)"; this.SerialPortName = serialPortName; this.SerialConnect(this.SerialPortName); }