Пример #1
0
 /// <summary>
 /// Resets the progress bar.
 /// </summary>
 public static void ResetProgress()
 {
     CurrentProgress = 0;
     CurrentEnd      = 0;
     if ((ModelLoaderWorker?.IsBusy).GetValueOrDefault(false))
     {
         ModelLoaderWorker?.ReportProgress(CurrentProgress, CurrentEnd);
     }
     else
     {
         if (Progress != null)
         {
             Progress.Value   = 0;
             Progress.Maximum = 0;
         }
     }
 }
Пример #2
0
 /// <summary>
 /// Increments the maximum value of the progress bar.
 /// </summary>
 /// <param name="num"></param>
 public static void IncrementEnd(int num = 1)
 {
     CurrentEnd += num;
     ModelLoaderWorker?.ReportProgress(CurrentProgress, CurrentEnd);
 }
Пример #3
0
 /// <summary>
 /// Alters the progress bar's appearance.
 /// </summary>
 /// <param name="state"></param>
 public static void SetProgressState(ProgressBarState state)
 {
     ModelLoaderWorker?.ReportProgress(-1, state);
 }
Пример #4
0
 /// <summary>
 /// Reports progress to <see cref="ModelLoaderWorker"/> if it is not <see langword="null"/>.<para/>
 /// Unlike the typical <see cref="ReportProgress(int)"/> method of <see cref="BackgroundWorker"/>, this takes in an arbitrary number that directly sets the progress bar's value.
 /// </summary>
 /// <param name="numLoaded"></param>
 public static void ReportProgress(int numLoaded)
 {
     CurrentProgress = numLoaded;
     ModelLoaderWorker?.ReportProgress(numLoaded);
 }