public void AddMultipleUpdates(List <Device> devices) { try { Waiting(); foreach (var device in devices) { if (!Exists(device)) { var newProgCtl = new FileTransferUI(this, device, createMissingDirs, Paths.GKExtractDir, Paths.GKRemoteDir, "Gatekeeper Update", progressControls.Count + 1); progressControls.Add(newProgCtl); newProgCtl.CriticalStopError += CriticalStop; } } ProgressControlsTable.SuspendLayout(); this.SuspendLayout(); ProgressControlsTable.Controls.AddRange(progressControls.ToArray()); ProgressControlsTable.ResumeLayout(); this.ResumeLayout(); ProcessUpdates(); this.Show(); this.WindowState = FormWindowState.Normal; this.Activate(); } finally { DoneWaiting(); } }
public void AddUpdate(Device device) { try { if (!Exists(device)) { var newProgCtl = new FileTransferUI(this, device, createMissingDirs, Paths.GKExtractDir, Paths.GKRemoteDir, "Gatekeeper Update", progressControls.Count + 1); ProgressControlsTable.Controls.Add(newProgCtl); progressControls.Add(newProgCtl); newProgCtl.CriticalStopError += CriticalStop; ProcessUpdates(); } else { var blah = OtherFunctions.Message("An update for device " + device.Serial + " already exists. Do you want to restart the update for this device?", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation, "Duplicate Update", this); if (blah == DialogResult.OK) { StartUpdateByDevice(device); } } } finally { this.Show(); this.WindowState = FormWindowState.Normal; this.Activate(); } }
public CopyFilesForm(ExtendedForm parentForm, Device targetDevice, string sourceDirectory, string targetDirectory) : base(parentForm) { InitializeComponent(); this.Owner = parentForm; pushFilesControl = new FileTransferUI(this, targetDevice, true, sourceDirectory, targetDirectory, "Push Files"); this.Controls.Add(pushFilesControl); pushFilesControl.CriticalStopError += new System.EventHandler(CopyCritcalError); pushFilesControl.Disposed += PushFilesControl_Disposed; this.Show(); }