Example #1
0
 // set progress from 0-100
 public void SetProgressDone(double done, string workingOn)
 {
     lock (this)
     {
         PercInfo last = this.PercInfos.Last();
         if (last != null)
         {
             last.Done      = done;
             last.WorkingOn = workingOn;
         }
     }
 }
Example #2
0
 // sum ratios in one function should be 1
 public void SetProgressRatio(double ratio, string workingOn)
 {
     lock (this)
     {
         PercInfo last = this.PercInfos.Last();
         if (last != null)
         {
             last.Ratio     = ratio;
             last.WorkingOn = workingOn;
         }
     }
 }
Example #3
0
        public void RemoveProgress()
        {
            lock (this)
            {
                PercInfo lastRemoved = this.PercInfos.Last();
                this.PercInfos.RemoveLast();

                PercInfo last = this.PercInfos.Last();
                if (last != null)
                {
                    last.Done += last.Ratio * lastRemoved.Done;
                }
            }
        }