// Token: 0x0600020F RID: 527 RVA: 0x00015544 File Offset: 0x00013744 private void ComPortConfig_Load(object sender, EventArgs e) { this.mainFrm = (MainFrm)base.Owner; string text = MiAppConfig.Get("mtkComs"); string[] array = text.Split(new char[] { ',' }); int num = 0; foreach (object obj in this.groupBoxComs.Controls) { Control control = (Control)obj; if (num > array.Length - 1) { break; } if (control is TextBox) { TextBox textBox = control as TextBox; if (string.IsNullOrEmpty(textBox.Text)) { textBox.Text = array[num]; num++; } } } }
// Token: 0x060000ED RID: 237 RVA: 0x0000C980 File Offset: 0x0000AB80 private void cmbChip_SelectedValueChanged(object sender, EventArgs e) { string text = this.cmbChip.SelectedItem.ToString(); MiAppConfig.SetValue("chip", text); this.mainFrm.chip = text; this.mainFrm.SetChip(text); }
// Token: 0x060000EA RID: 234 RVA: 0x0000C834 File Offset: 0x0000AA34 private void btnOK_Click(object sender, EventArgs e) { MiAppConfig.SetValue("rawprogram", this.txtRaw.Text.Trim()); MiAppConfig.SetValue("patch", this.txtPatch.Text.Trim()); MiAppConfig.SetValue("checkPoint", this.txtCheckPoint.Text.Trim()); base.Close(); base.Dispose(); }
// Token: 0x060000F0 RID: 240 RVA: 0x0000CA38 File Offset: 0x0000AC38 private void btnPatchSelect_Click(object sender, EventArgs e) { DialogResult dialogResult = this.openFileDialog.ShowDialog(); if (dialogResult == DialogResult.OK) { string fileName = this.openFileDialog.FileName; if (!string.IsNullOrEmpty(fileName)) { this.txtPatch.Text = fileName; MiAppConfig.SetValue("patch", fileName); } } }
// Token: 0x060000E5 RID: 229 RVA: 0x0000C658 File Offset: 0x0000A858 private void ConfigurationFrm_Load(object sender, EventArgs e) { this.chkMD5.Checked = (MiAppConfig.GetAppConfig("checkMD5").ToLower() == "true"); this.mainFrm = (MainFrm)base.Owner; this.chkRbv.Checked = this.mainFrm.ReadBackVerify; this.chkWriteDump.Checked = this.mainFrm.OpenWriteDump; this.chkReadDump.Checked = this.mainFrm.OpenReadDump; this.chkVerbose.Checked = this.mainFrm.Verbose; this.chkAutoDetect.Checked = this.mainFrm.AutoDetectDevice; this.cmbFactory.SelectedItem = MiAppConfig.Get("factory").ToString(); this.cmbChip.SelectedItem = MiAppConfig.Get("chip").ToString(); this.cmbMainProgram.SelectedItem = MiAppConfig.Get("mainProgram").ToString(); this.openFileDialog.InitialDirectory = this.mainFrm.SwPath; this.txtRaw.Text = MiAppConfig.Get("rawprogram").ToString(); this.txtPatch.Text = MiAppConfig.Get("patch").ToString(); this.txtCheckPoint.Text = MiAppConfig.Get("checkPoint").ToString(); }
// Token: 0x060000FF RID: 255 RVA: 0x0000E160 File Offset: 0x0000C360 public byte[] GetBytesFromFile(long offset, int size, out int n, out float percent) { byte[] array; if (MemImg.isHighSpeed && this.filePath.ToLower().IndexOf(MiAppConfig.Get("noquick")) < 0) { array = MemImg.GetBytesFromFile(this.filePath, offset, size, out percent); n = array.Length; } else { long length = this.fileStream.Length; array = new byte[size]; this.fileStream.Seek(offset, SeekOrigin.Begin); n = this.fileStream.Read(array, 0, size); percent = (float)offset / (float)length; } FlashingDevice.UpdateDeviceStatus(this.portName, new float?(percent), null, "flashing", false); return(array); }
// Token: 0x060000EC RID: 236 RVA: 0x0000C8EC File Offset: 0x0000AAEC private void cmbFactory_SelectedValueChanged(object sender, EventArgs e) { string text = this.cmbFactory.SelectedItem.ToString(); if (!(text != "please choose")) { MiAppConfig.SetValue("factory", ""); this.mainFrm.factory = ""; this.mainFrm.SetFactory(""); return; } if (FactoryCtrl.SetFactory(text)) { MiAppConfig.SetValue("factory", text); this.mainFrm.factory = text; this.mainFrm.SetFactory(text); return; } MessageBox.Show("set factory failed!"); }
// Token: 0x06000210 RID: 528 RVA: 0x0001560C File Offset: 0x0001380C private void btnOK_Click(object sender, EventArgs e) { List <string> list = new List <string>(); foreach (object obj in this.groupBoxComs.Controls) { Control control = (Control)obj; if (control is TextBox) { TextBox textBox = control as TextBox; if (!string.IsNullOrEmpty(textBox.Text)) { list.Add(textBox.Text.Trim()); } } } list.Sort(); string appValue = string.Join(",", list.ToArray()); MiAppConfig.SetValue("mtkComs", appValue); base.Close(); }
// Token: 0x060000FA RID: 250 RVA: 0x0000D9CC File Offset: 0x0000BBCC private bool openFile(string filePath) { this.filePath = filePath; bool result = false; if (MemImg.isHighSpeed && filePath.ToLower().IndexOf(MiAppConfig.Get("noquick")) < 0) { this.fileLength = MemImg.mapImg(filePath); Log.w(this.portName, string.Format("Image {0} ,quick transfer", filePath)); } try { FileInfo fileInfo = new FileInfo(filePath); this.fileLength = fileInfo.Length; this.fileStream = File.OpenRead(filePath); result = true; } catch (Exception ex) { result = false; throw new Exception(ex.Message); } return(result); }
// Token: 0x060000E4 RID: 228 RVA: 0x0000C62C File Offset: 0x0000A82C private void chkMD5_CheckedChanged(object sender, EventArgs e) { MiAppConfig.SetValue("checkMD5", this.chkMD5.Checked.ToString()); }
// Token: 0x060000EE RID: 238 RVA: 0x0000C9C4 File Offset: 0x0000ABC4 private void cmbMainProgram_SelectedValueChanged(object sender, EventArgs e) { string appValue = this.cmbMainProgram.SelectedItem.ToString(); MiAppConfig.SetValue("mainProgram", appValue); }
private void MainFrm_FormClosing(object sender, FormClosingEventArgs e) { MiAppConfig.SetValue("swPath", txtPath.Text.ToString()); }
private void MainFrm_Load(object sender, EventArgs e) { SetLanguage(); txtPath.Text = MiAppConfig.Get("swPath"); }
private void ConfigurationFrm_Load(object sender, EventArgs e) { chkMD5.Checked = MiAppConfig.GetAppConfig("checkMD5").ToLower() == "true"; }