Beispiel #1
0
        private void StartButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Assert(deviceList.SelectedIndex != -1, "No connected devices!\n\r" +
                       "Check connection and required drivers.");

                Assert(deviceBootloader.SelectedIndex != -1, "Couldn't find any valid bootloader!");
            }
            catch
            {
                return;
            }

            IsEnabled = false;

            var eventArgs = new FormEventArgs
            {
                TargetMode = IsSelectedDeviceInFastbootMode
                    ? UsbController.Device.DMode.Fastboot
                    : UsbController.Device.DMode.DownloadVCOM,
                Target        = deviceList.SelectedItem.ToString(),
                DisableFBLOCK = disableFBLOCK.IsChecked.Value,
                Reboot        = reboot.IsChecked.Value
            };

            if (!IsSelectedDeviceInFastbootMode)
            {
                eventArgs.Bootloader = bootloaders.First(x => x.Title == deviceBootloader.SelectedItem.ToString());
            }

            OnFormSubmit?.Invoke(eventArgs);
        }
Beispiel #2
0
        private void StartButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                Assert(deviceList.SelectedIndex != -1, "No connected devices!\n\r" +
                       "Check connection and required drivers.");

                Assert(deviceBootloader.SelectedIndex != -1, "Couldn't find any valid bootloader!");

                Assert(VerifyNVValue(nvSerialNumber.Text), "Serial number is not valid.");

                Assert(VerifyNVValue(nvBidNumber.Text), "BoardID is not valid.");

                Assert(VerifyNVValue(nvUnlockCode.Text, true), "Unlock code is not valid.");
            }
            catch
            {
                return;
            }

            IsEnabled = false;

            var eventArgs = new FormEventArgs
            {
                TargetMode = IsSelectedDeviceInFastbootMode
                    ? UsbController.Device.DMode.Fastboot
                    : UsbController.Device.DMode.DownloadVCOM,
                Target        = deviceList.SelectedItem.ToString(),
                BoardID       = nvBidNumber.Text,
                UnlockCode    = nvUnlockCode.Text,
                SerialNumber  = nvSerialNumber.Text,
                DisableFBLOCK = disableFBLOCK.IsChecked.Value
            };

            if (!IsSelectedDeviceInFastbootMode)
            {
                eventArgs.Bootloader = bootloaders.First(x => x.Title == deviceBootloader.SelectedItem.ToString());
            }

            OnFormSubmit?.Invoke(eventArgs);
        }