1 | #Region "Microsoft.VisualBasic::64e4d2437f73150b7bdc12d88ba8bdd8, Microsoft.VisualBasic.Core\ApplicationServices\Terminal\ProgressBar\AnimatedBar.vb" |
2 | |
3 | ' Author: |
4 | ' |
5 | ' asuka (amethyst.asuka@gcmodeller.org) |
6 | ' xie (genetics@smrucc.org) |
7 | ' xieguigang (xie.guigang@live.com) |
8 | ' |
9 | ' Copyright (c) 2018 GPL3 Licensed |
10 | ' |
11 | ' |
12 | ' GNU GENERAL PUBLIC LICENSE (GPL3) |
13 | ' |
14 | ' |
15 | ' This program is free software: you can redistribute it and/or modify |
16 | ' it under the terms of the GNU General Public License as published by |
17 | ' the Free Software Foundation, either version 3 of the License, or |
18 | ' (at your option) any later version. |
19 | ' |
20 | ' This program is distributed in the hope that it will be useful, |
21 | ' but WITHOUT ANY WARRANTY; without even the implied warranty of |
22 | ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
23 | ' GNU General Public License for more details. |
24 | ' |
25 | ' You should have received a copy of the GNU General Public License |
26 | ' along with this program. If not, see <http://www.gnu.org/licenses/>. |
27 | |
28 | |
29 | |
30 | ' /********************************************************************************/ |
31 | |
32 | ' Summaries: |
33 | |
34 | ' Class AnimatedBar |
35 | ' |
36 | ' Constructor: (+1 Overloads) Sub New |
37 | ' Sub: [Step] |
38 | ' |
39 | ' |
40 | ' /********************************************************************************/ |
41 | |
42 | #End Region |
43 | |
44 | Namespace Terminal.ProgressBar |
45 | |
46 | Public Class AnimatedBar |
47 | Inherits AbstractBar |
48 | |
49 | Dim animation As List(Of String) |
50 | Dim counter As Integer |
51 | |
52 | Public Sub New() |
53 | MyBase.New() |
54 | |
55 | animation = New List(Of String)() From {"/", "-", "\", "|"} |
56 | counter = 0 |
57 | End Sub |
58 | |
59 | ''' <summary> |
60 | ''' prints the character found in the animation according to the current index |
61 | ''' </summary> |
62 | Public Overrides Sub [Step]() |
63 | Console.Write(vbCr) |
64 | Console.Write(animation(counter) & vbBack) |
65 | |
66 | counter += 1 |
67 | |
68 | If counter = animation.Count Then |
69 | counter = 0 |
70 | End If |
71 | End Sub |
72 | End Class |
73 | End Namespace |