private void RefreshFileInformation() { if (InvokeRequired) { Invoke((Action)RefreshFileInformation); } else if (!Visible) { delayedUpdates |= DelayedUpdates.FileInformation; return; } else { lock (syncRoot) fileInformationLabel.Text = string.Format(Properties.Resources.Culture, Properties.Resources.ExtractionFileMessage, processedFileCount, totalFileCount, currentFileName); } }
private void RefreshStatus() { if (InvokeRequired) { Invoke((Action)RefreshStatus); } else if (!Visible) { delayedUpdates |= DelayedUpdates.Status; return; } else { lock (syncRoot) { statusLabel.Text = string.Format(Properties.Resources.Culture, Properties.Resources.ExtractionStatusMessage, Program.FormatFileSize(processedSize), Program.FormatFileSize(totalSize)); this.progressBar.Maximum = (int)(this.totalSize / this.sizeUnit); this.progressBar.Value = (int)(this.processedSize / this.sizeUnit); } } }
protected override void OnVisibleChanged(EventArgs e) { if (Visible) { if ((delayedUpdates & DelayedUpdates.Status) != DelayedUpdates.None) { RefreshStatus(); } if ((delayedUpdates & DelayedUpdates.FileInformation) != DelayedUpdates.None) { RefreshFileInformation(); } delayedUpdates = DelayedUpdates.None; ThreadPool.QueueUserWorkItem(state => { var @this = state as ExtractionProgressionForm; @this.extractionProcedure(@this.dialog, @this.stateObject); if (@this.Visible) { @this.Invoke ( (Action)(() => { @this.abortButton.Enabled = false; @this.DialogResult = DialogResult.OK; @this.Hide(); }) ); } }, this); } base.OnVisibleChanged(e); }
private void RefreshStatus() { if (InvokeRequired) Invoke((Action)RefreshStatus); else if (!Visible) { delayedUpdates |= DelayedUpdates.Status; return; } else lock (syncRoot) { statusLabel.Text = string.Format(Properties.Resources.Culture, Properties.Resources.ExtractionStatusMessage, Program.FormatFileSize(processedSize), Program.FormatFileSize(totalSize)); this.progressBar.Maximum = (int)(this.totalSize / this.sizeUnit); this.progressBar.Value = (int)(this.processedSize / this.sizeUnit); } }
private void RefreshFileInformation() { if (InvokeRequired) Invoke((Action)RefreshFileInformation); else if (!Visible) { delayedUpdates |= DelayedUpdates.FileInformation; return; } else lock (syncRoot) fileInformationLabel.Text = string.Format(Properties.Resources.Culture, Properties.Resources.ExtractionFileMessage, processedFileCount, totalFileCount, currentFileName); }
protected override void OnVisibleChanged(EventArgs e) { if (Visible) { if ((delayedUpdates & DelayedUpdates.Status) != DelayedUpdates.None) RefreshStatus(); if ((delayedUpdates & DelayedUpdates.FileInformation) != DelayedUpdates.None) RefreshFileInformation(); delayedUpdates = DelayedUpdates.None; ThreadPool.QueueUserWorkItem(state => { var @this = state as ExtractionProgressionForm; @this.extractionProcedure(@this.dialog, @this.stateObject); if (@this.Visible) @this.Invoke ( (Action)(() => { @this.abortButton.Enabled = false; @this.DialogResult = DialogResult.OK; @this.Hide(); }) ); }, this); } base.OnVisibleChanged(e); }