private void buttonErase_Click(object sender, EventArgs e) { MFDevice dev = ConnectToSelectedDevice(); if (dev != null) { if (DialogResult.Yes == MessageBox.Show(Properties.Resources.MessageEraseConfirmation, Properties.Resources.TitleEraseConfirmation, MessageBoxButtons.YesNo)) { DeploymentStatusDialog dlg = new DeploymentStatusDialog(dev); dlg.StartPosition = FormStartPosition.CenterParent; dlg.ShowDialog(this); } DisconnectFromSelectedDevice(); } }
private void buttonDeploy_Click(object sender, EventArgs e) { ReadOnlyCollection <string> files = this.Files; string[] sigfiles = new string[files.Count]; int cnt = 0; if (files.Count <= 0) { MessageBox.Show(Properties.Resources.WarningNoFilesForDeploy, Properties.Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } foreach (string file in files) { if (file.Trim().Length == 0) { continue; } if (!File.Exists(file)) { MessageBox.Show(this, string.Format(Properties.Resources.ErrorFileCantOpen, file), Properties.Resources.ErrorTitleImageFile, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } string signature_file = GetSignatureFileName(file); sigfiles[cnt++] = signature_file; } // update MRU items AddMRUFiles(comboBoxImageFile.Text.Trim()); MFDevice dev = ConnectToSelectedDevice(); if (dev != null) { DeploymentStatusDialog dlg = new DeploymentStatusDialog(dev, files, sigfiles); dlg.StartPosition = FormStartPosition.CenterParent; dlg.ShowDialog(this); DisconnectFromSelectedDevice(); } }
private void buttonErase_Click(object sender, EventArgs e) { MFDevice dev = ConnectToSelectedDevice(); if (dev != null) { EraseDialog ed = new EraseDialog(dev); ed.StartPosition = FormStartPosition.CenterParent; if (DialogResult.OK == ed.ShowDialog(this)) { DeploymentStatusDialog dlg = new DeploymentStatusDialog(dev, ed.EraseBlocks); dlg.StartPosition = FormStartPosition.CenterParent; dlg.ShowDialog(this); } DisconnectFromSelectedDevice(); } }
private void buttonDeploy_Click(object sender, EventArgs e) { ReadOnlyCollection<string> files = this.Files; string[] sigfiles = new string[files.Count]; int cnt=0; if (files.Count <= 0) { MessageBox.Show(Properties.Resources.WarningNoFilesForDeploy, Properties.Resources.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } foreach (string file in files) { if (file.Trim().Length == 0) continue; if (!File.Exists(file)) { MessageBox.Show(this, string.Format( Properties.Resources.ErrorFileCantOpen, file ), Properties.Resources.ErrorTitleImageFile, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } string signature_file = GetSignatureFileName(file); sigfiles[cnt++] = signature_file; } // update MRU items AddMRUFiles(comboBoxImageFile.Text.Trim()); MFDevice dev = ConnectToSelectedDevice(); if (dev != null) { DeploymentStatusDialog dlg = new DeploymentStatusDialog(dev, files, sigfiles); dlg.StartPosition = FormStartPosition.CenterParent; dlg.ShowDialog(this); DisconnectFromSelectedDevice(); } else { MessageBox.Show(this, "Please select a valid device!", "No device selected"); } }
private void buttonErase_Click(object sender, EventArgs e) { MFDevice dev = ConnectToSelectedDevice(); if (dev != null) { if (DialogResult.Yes == MessageBox.Show(Properties.Resources.MessageEraseConfirmation, Properties.Resources.TitleEraseConfirmation, MessageBoxButtons.YesNo)) { DeploymentStatusDialog dlg = new DeploymentStatusDialog(dev); dlg.StartPosition = FormStartPosition.CenterParent; dlg.ShowDialog(this); } DisconnectFromSelectedDevice(); } }