src/BandcampDownloader/UI/Dialogs/WindowMain.xaml.cs
/// <summary>
/// Updates the state of the controls.
/// </summary>
/// <param name="downloadStarted">True if the download just started; false if it just stopped.</param>
Updates the state of the controls.
Updates the state of the controls .
private void UpdateControlsState(bool downloadStarted) {
            if (downloadStarted) {
                buttonBrowse.IsEnabled = false;
                buttonStart.IsEnabled = false;
                buttonStop.IsEnabled = true;
                checkBoxDownloadDiscography.IsEnabled = false;
                labelProgress.Content = "";
                progressBar.Foreground = new SolidColorBrush((Color) ColorConverter.ConvertFromString("#FF01D328")); 
                progressBar.IsIndeterminate = true;
                progressBar.Value = progressBar.Minimum;
                richTextBoxLog.Document.Blocks.Clear();
                TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Indeterminate;
                TaskbarItemInfo.ProgressValue = 0;
                textBoxDownloadsPath.IsReadOnly = true;
                textBoxUrls.IsReadOnly = true;
            } else {
                buttonBrowse.IsEnabled = true;
                buttonStart.IsEnabled = true;
                buttonStop.IsEnabled = false;
                checkBoxDownloadDiscography.IsEnabled = true;
                labelDownloadSpeed.Content = "";
                progressBar.Foreground = new SolidColorBrush((Color) ColorConverter.ConvertFromString("#FF01D328")); 
                progressBar.IsIndeterminate = false;
                progressBar.Value = progressBar.Minimum;
                TaskbarItemInfo.ProgressState = TaskbarItemProgressState.None;
                TaskbarItemInfo.ProgressValue = 0;
                textBoxDownloadsPath.IsReadOnly = false;
                textBoxUrls.IsReadOnly = false;
            }
        }
private void UpdateControlsState ( bool downloadStarted ) { if ( downloadStarted ) { buttonBrowse . IsEnabled = false ; buttonStart . IsEnabled = false ; buttonStop . IsEnabled = true ; checkBoxDownloadDiscography . IsEnabled = false ; labelProgress . Content = " " ; progressBar . Foreground = new SolidColorBrush ( ( Color ) ColorConverter . ConvertFromString ( " " ) ) ; progressBar . IsIndeterminate = true ; progressBar . Value = progressBar . Minimum ; richTextBoxLog . Document . Blocks . Clear ( ) ; TaskbarItemInfo . ProgressState = TaskbarItemProgressState . Indeterminate ; TaskbarItemInfo . ProgressValue = 0 ; textBoxDownloadsPath . IsReadOnly = true ; textBoxUrls . IsReadOnly = true ; } else { buttonBrowse . IsEnabled = true ; buttonStart . IsEnabled = true ; buttonStop . IsEnabled = false ; checkBoxDownloadDiscography . IsEnabled = true ; labelDownloadSpeed . Content = " " ; progressBar . Foreground = new SolidColorBrush ( ( Color ) ColorConverter . ConvertFromString ( " " ) ) ; progressBar . IsIndeterminate = false ; progressBar . Value = progressBar . Minimum ; TaskbarItemInfo . ProgressState = TaskbarItemProgressState . None ; TaskbarItemInfo . ProgressValue = 0 ; textBoxDownloadsPath . IsReadOnly = false ; textBoxUrls . IsReadOnly = false ; } }
Updates the state of the controls.
Updates the state of the controls .
// We just started the download // Green // We just finished the download (or user has cancelled) // Green
downloadStarted
bool
True if the download just started; false if it just stopped.
True if the download just started ; false if it just stopped .