Patcher.UI.Windows.MainWindow.Progess_Updated C# (CSharp) Method

Progess_Updated() private method

private Progess_Updated ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
        private void Progess_Updated(object sender, EventArgs e)
        {
            HandlePause();

            Dispatcher.Invoke(DispatcherPriority.Background, new Action(() =>
            {
                if (currentProgress.IsCompleted)
                {
                    currentProgress.Updated -= Progess_Updated;
                    StatusPanel.Visibility = Visibility.Visible;
                    StatusProgressBar.Visibility = Visibility.Visible;
                    StatusProgressBar.Value = currentProgress.Total;
                    StatusProgressBar.Maximum = currentProgress.Total;
                    StatusLabel.Content = currentProgress.Title;
                    StatusText.Text = string.Empty;
                }
                else
                {
                    StatusPanel.Visibility = Visibility.Visible;
                    StatusProgressBar.Visibility = Visibility.Visible;
                    StatusProgressBar.Value = currentProgress.Current;
                    StatusProgressBar.Maximum = currentProgress.Total;
                    StatusLabel.Content = currentProgress.Title;
                    StatusText.Text = currentProgress.Text;
                }
            }));
        }