// 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: 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: 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); }
private void MainFrm_Load(object sender, EventArgs e) { SetLanguage(); txtPath.Text = MiAppConfig.Get("swPath"); }