mirror of
https://github.com/mashed-potatoes/PotatoNV.git
synced 2024-11-12 18:04:14 +01:00
Finish NVForm class
This commit is contained in:
parent
1c20528fe3
commit
cb6292a977
1 changed files with 20 additions and 10 deletions
|
@ -48,6 +48,11 @@ namespace PotatoNV_next.Controls
|
||||||
{
|
{
|
||||||
deviceBootloader.SelectedIndex = 0;
|
deviceBootloader.SelectedIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var random = new Random(Guid.NewGuid().GetHashCode());
|
||||||
|
|
||||||
|
nvUnlockCode.Text = new string(Enumerable.Repeat("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", 16)
|
||||||
|
.Select(s => s[random.Next(s.Length)]).ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
public class FormEventArgs : EventArgs
|
public class FormEventArgs : EventArgs
|
||||||
|
@ -134,19 +139,24 @@ namespace PotatoNV_next.Controls
|
||||||
|
|
||||||
IsEnabled = false;
|
IsEnabled = false;
|
||||||
|
|
||||||
if (IsSelectedDeviceInFastbootMode)
|
var eventArgs = new FormEventArgs
|
||||||
{
|
{
|
||||||
OnFormSubmit?.Invoke(new FormEventArgs {
|
TargetMode = IsSelectedDeviceInFastbootMode
|
||||||
TargetMode = UsbController.Device.DMode.Fastboot,
|
? UsbController.Device.DMode.Fastboot
|
||||||
Target = deviceList.SelectedItem.ToString(),
|
: UsbController.Device.DMode.DownloadVCOM,
|
||||||
BoardID = nvBidNumber.Text,
|
Target = deviceList.SelectedItem.ToString(),
|
||||||
UnlockCode = nvUnlockCode.Text,
|
BoardID = nvBidNumber.Text,
|
||||||
SerialNumber = nvSerialNumber.Text,
|
UnlockCode = nvUnlockCode.Text,
|
||||||
DisableFBLOCK = disableFBLOCK.IsChecked.Value
|
SerialNumber = nvSerialNumber.Text,
|
||||||
});
|
DisableFBLOCK = disableFBLOCK.IsChecked.Value
|
||||||
|
};
|
||||||
|
|
||||||
return;
|
if (!IsSelectedDeviceInFastbootMode)
|
||||||
|
{
|
||||||
|
eventArgs.Bootloader = bootloaders.First(x => x.Title == deviceBootloader.SelectedItem.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OnFormSubmit?.Invoke(eventArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void NVForm_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
|
private void NVForm_IsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||||
|
|
Loading…
Reference in a new issue