Пример #1
0
        private void Initialize()
        {
            m_worker.DoWork             += Worker_DoWork;
            m_worker.ProgressChanged    += (s, e) => ProgressLabel.Text = e.ProgressPercentage + @"%";
            m_worker.RunWorkerCompleted += (s, e) => ProgressLabel.Text = @"Operation completed";

            m_usbConnector.DeviceConnected += DeviceConnected;
            m_usbConnector.StartMonitoring();
            m_comConnector.MessageReceived += COMMessage_Received;

            Closing += (s, e) => Safe.Execute(() => m_comConnector.Disconnect());
        }
        private void InitializeControls()
        {
            DeviceNameTextBox.BackColor      = Color.White;
            HardwareVersionTextBox.BackColor = Color.White;
            FirmwareVersionTextBox.BackColor = Color.White;
            BootModeTextBox.BackColor        = Color.White;

            DeviceNameTextBox.ReadOnly      = true;
            HardwareVersionTextBox.ReadOnly = true;
            FirmwareVersionTextBox.ReadOnly = true;
            BootModeTextBox.ReadOnly        = true;

            m_connector.DeviceConnected += DeviceConnected;
            m_connector.StartMonitoring();
            Closing += (s, e) => m_connector.StopMonitoring();

            LogoButton.Click           += LogoButton_Click;
            UpdateButton.Click         += UpdateButton_Click;
            UpdateFromFileButton.Click += UpdateFromFileButton_Click;

            ResetDataflashButton.Click += ResetDataflashButton_Click;
            ReadDataflashButton.Click  += ReadDataflashButton_Click;
            WriteDataflashButton.Click += WriteDataflashButton_Click;
        }