using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Linq; using System.Reflection; using System.Threading.Tasks; using System.Windows.Forms; using BirdyFlash.Lib; using MaterialSkin; using MaterialSkin.Controls; namespace BirdyFlash { partial class ChangeSerialDialog : MaterialForm { public string oldSN; public string newSN; public ChangeSerialDialog() { InitializeComponent(); } private void ChangeSerialDialog_Load(object sender, EventArgs e) { MaterialSkinManager.Instance.AddFormToManage(this); } private void materialTextBox1_TextChanged(object sender, EventArgs e) { } internal void Setup(DeviceInfo deviceInfo) { string oldSerial = deviceInfo.deviceSerial; this.oldSN = oldSerial; switch(deviceInfo.model) { case "BirdyIOT": oldSerial = deviceInfo.deviceSerial[0] + deviceInfo.deviceSerial.Substring(2); break; } this.newSN = ""; this.txtCurrentSN.Text = oldSerial; this.txtNewSN.MaxLength = oldSerial.Length; } private void materialButton1_Click(object sender, EventArgs e) { this.DialogResult = DialogResult.Cancel; this.Close(); } private void materialButton2_Click(object sender, EventArgs e) { this.newSN = this.txtNewSN.Text; this.DialogResult = DialogResult.Yes; this.Close(); } } }