Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/22/18 12:37:04 (6 years ago)
Author:
pfleck
Message:

#2845 Combined separate Show methods into single one with enum parameter specifying the ProgressMode. Renamed Continuous and Marquee to Determinate and Indeterminate.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2845_EnhancedProgress/HeuristicLab.MainForm.WindowsForms/3.3/Controls/ProgressView.cs

    r16311 r16317  
    163163      }
    164164
    165       if (content.ProgressBarMode == ProgressBarMode.Continuous) {
    166         progressBar.Style = ProgressBarStyle.Continuous;
    167         progressBar.Value = (int)Math.Round(progressBar.Minimum + content.ProgressValue * (progressBar.Maximum - progressBar.Minimum));
    168       } else {
    169         progressBar.Style = ProgressBarStyle.Marquee;
    170         progressBar.Value = 0;
     165      switch (content.ProgressMode) {
     166        case ProgressMode.Determinate:
     167          progressBar.Style = ProgressBarStyle.Continuous;
     168          progressBar.Value = (int)Math.Round(progressBar.Minimum + content.ProgressValue * (progressBar.Maximum - progressBar.Minimum));
     169          break;
     170        case ProgressMode.Indeterminate:
     171          progressBar.Style = ProgressBarStyle.Marquee;
     172          progressBar.Value = 0;
     173          break;
     174        default:
     175          throw new NotImplementedException($"Invalid Progress Mode: {content.ProgressMode}");
    171176      }
    172177    }
Note: See TracChangeset for help on using the changeset viewer.