Exemplo n.º 1
0
 /// <summary>
 /// Sets progress values
 /// </summary>
 /// <param name="progress">Current progress</param>
 public void SetProgress(ProgressInfo progress)
 {
     if (progress.Done)
     {
         Close();
     }
     else
     {
         FileInfo.SetText(string.Format(FILE_INFO_TEMPLATE, progress.Description));
         FileProgress.SetProgress(progress);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Sets progress values
 /// </summary>
 /// <param name="itemProgress">Current progress</param>
 /// <param name="totalProgress">Total progress</param>
 public void SetProgress(ProgressInfo itemProgress, ProgressInfo totalProgress)
 {
     if (totalProgress.Done)
     {
         Close();
     }
     else
     {
         FileSourceInfo.SetText(string.Format(FILE_INFO_TEMPLATE, itemProgress.Description));
         FileProgress.SetProgress(itemProgress);
         TotalFilesCount.SetText("Files:" + $"{totalProgress.Count.ToString("#")}/{totalProgress.TotalCount.ToString("#")}".PadLeft(TotalFilesCount.Width - 6));
         TotalBytesCount.SetText("Bytes:" + $"{totalProgress.Proceded.ToString("#")}/{totalProgress.Total.ToString("#")}".PadLeft(TotalBytesCount.Width - 6));
         TotalProgress.SetProgress(totalProgress);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Sets the progress of the operation and updates the control
 /// </summary>
 /// <param name="progress"></param>
 public void SetProgress(ProgressInfo progress)
 {
     Progress = progress;
     Update();
 }
Exemplo n.º 4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="rectangle">Control position and size</param>
 /// <param name="size">The size relative to which the values of the rectangle parameter are calculated</param>
 /// <param name="progress">Information about the progress of execution </param>
 /// <returns></returns>
 public ProgressBar(string rectangle, Size size, ProgressInfo progress) : base(rectangle, size, Alignment.None)
 {
     Progress = progress;
 }