Beispiel #1
0
 public void SincePrintProgress()
 {
     Console.CursorVisible = false;
     Console.Write(" =====> ");
     while (Percent <= stepProgress)
     {
         if (stepProgress == Percent)
         {
             stepProgress = 99;
         }
         // Generate new state
         int width = (int)(Percent / 100 * barLength);
         int fill  = barLength - width;
         //Delete Last String
         string clear = string.Empty.PadRight(LastOutputLength, '\b');
         Console.Write(clear);
         Console.Write((Percent < 10 ? "  " : (Percent >= 10 && Percent < 100) ? " " : "") + "{0:0.0}% [ ", Percent); CColor.WriteC(string.Empty.PadLeft(width, '█'), "green"); Console.Write("{0} ] - ", string.Empty.PadLeft(fill, ' '));
         LastOutputLength = 5 + "% [ ".Length + barLength + " ] - ".Length;
     }
     CColor.WriteC(" DONE", "green"); Console.WriteLine('!');
     Console.CursorVisible = true;
 }
Beispiel #2
0
        public void UpdatePrintProgress(double PercentUp)
        {
            Console.CursorVisible = false;
            // Generate new state
            int width = (int)(PercentUp / 100 * barLength);
            int fill  = barLength - width;
            //Delete Last String
            string clear = string.Empty.PadRight(LastOutputLength, '\b');

            Console.Write(clear);
            if (true)
            {
                Console.Write((Percent < 10 ? "  " : (PercentUp >= 10 && PercentUp < 100) ? " " : "") + "{0:0}% [ ", PercentUp); CColor.WriteC(string.Empty.PadLeft(width, '█'), "green"); Console.Write("{0} ] - ", string.Empty.PadLeft(fill, ' '));
                LastOutputLength = 3 + "% [ ".Length + barLength + " ] - ".Length;
            }
        }
Beispiel #3
0
 private static void DownloadFileCallback(object sender, AsyncCompletedEventArgs e)
 {
     CColor.WriteC(" DONE", "green"); Console.WriteLine("!");
 }