-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
70 lines (58 loc) · 1.75 KB
/
Program.cs
File metadata and controls
70 lines (58 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Test_ConsoleProgress
{
class Program
{
static ConsoleProgressBar.Options options=new ConsoleProgressBar.Options{
BarColor=ConsoleColor.Green,
TextColor=ConsoleColor.Gray,
fClearOnDone=true
};
static ConsoleProgressBar.Options options2=new ConsoleProgressBar.Options{
BarColor=ConsoleColor.DarkCyan,
TextColor=ConsoleColor.White,
maximumWidth=40,
fClearOnDone=true
};
static void Main(string[] args)
{
ConsoleProgressBar progress2 = new ConsoleProgressBar(options2);
Console.WriteLine("---------------------------------------------------------");
Console.WriteLine(" Previous Text");
for(int i=0; i<5; i++)
Console.WriteLine("Line "+i.ToString());
Console.WriteLine(" Previous Text");
while(true){
Console.WriteLine("---------------------------------------------------------");
using(ConsoleProgressBar progress = new ConsoleProgressBar(options) )
{
int i;
for (i=0; i<=100; i++)
{
progress.Update(i);
progress2.Update(i/2);
if(i==30) options.BarColor=ConsoleColor.Red;
if(i%20==0) Console.WriteLine($" text below {Console.CursorTop} ");
Thread.Sleep(50);
}
progress.Done(TextDone: " DONE!", ColorTextDone: ConsoleColor.Yellow );
for (i=50; i<=100; i++)
{
progress2.Update(i);
Thread.Sleep(50);
}
progress2.Done(TextDone: " DONE 2!", ColorTextDone: ConsoleColor.DarkCyan );
}
Thread.Sleep(500);
}
//Thread.Sleep(500);
//Console.WriteLine("demo end");
//Console.ReadKey();
}
}
}