コード例 #1
0
        public nRFupdateForm()
        {
            InitializeComponent();
            // Instantiate data dongle logic class
            usbDongle = new nRFupdateControl();

            // Add listeners to events triggered by USB logic
            usbDongle.DongleConnected += new EventHandler(usbDongle_Connected);
            usbDongle.DongleDisconnected += new EventHandler(usbDongle_Disconnected);
            usbDongle.DeviceConnected += new EventHandler<ConnectionEventArgs>(rfDevice_Connected);
            usbDongle.DeviceDisconnected += new EventHandler(rfDevice_Disconnected);
            usbDongle.HexVerified += new EventHandler<BoolEventArgs>(hex_Verified);
            usbDongle.UpdateStarted += new EventHandler(usbDongle_UpdateStarted);
            usbDongle.ReadyToRun += new EventHandler(usbDongle_ReadyToRun);

            // Status update event used to pass text messages to gui textbox
            usbDongle.StatusUpdate += new EventHandler<MessageEventArgs>(usbDongle_StatusUpdate);

            newVersionTextbox.KeyPress += new KeyPressEventHandler(newVersionTextbox_KeyPress);

            // Progress popup window
            pform1 = new ProgressForm(usbDongle);
        }