forked from vermi-zz/sharptools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProgressSpinner.cs
38 lines (36 loc) · 1006 Bytes
/
ProgressSpinner.cs
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
using System;
namespace su.oishiide.tools
{
public class ProgressSpinner
{
int counter;
public ProgressSpinner()
{
counter = 0;
}
public void Tick()
{
counter++;
switch (counter % 4)
{
case 0: Console.Write("/"); break;
case 1: Console.Write("-"); break;
case 2: Console.Write("\\"); break;
case 3: Console.Write("-"); break;
}
Console.SetCursorPosition(Console.CursorLeft - 1, Console.CursorTop);
}
public void Tick(int x, int y)
{
counter++;
switch (counter % 4)
{
case 0: Console.Write("/"); break;
case 1: Console.Write("-"); break;
case 2: Console.Write("\\"); break;
case 3: Console.Write("-"); break;
}
Console.SetCursorPosition(x, y);
}
}
}