File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 7
7
<PackageIcon >CLARiNET.ico</PackageIcon >
8
8
<PackageIconUrl />
9
9
<ApplicationIcon >CLARiNET.ico</ApplicationIcon >
10
+ <Version >1.0.1</Version >
10
11
</PropertyGroup >
11
12
12
13
<ItemGroup >
Original file line number Diff line number Diff line change @@ -9,14 +9,18 @@ namespace CLARiNET
9
9
{
10
10
class Program
11
11
{
12
+ private static ConsoleColor _savedForegroundColor = Console . ForegroundColor ;
13
+
12
14
static void Main ( string [ ] args )
13
15
{
14
16
Options options = new Options ( ) ;
15
17
string url = "https://{host}/ccx/cc-cloud-repo/collections/" ;
16
18
string host = "" ;
19
+ Program . _savedForegroundColor = Console . ForegroundColor ;
17
20
18
21
try
19
22
{
23
+ Console . CancelKeyPress += new ConsoleCancelEventHandler ( Cleanup ) ;
20
24
XDocument xDoc = XDocument . Parse ( Resources . WDEnvironments ) ;
21
25
List < XElement > envs = new List < XElement > ( xDoc . Descendants ( XName . Get ( "env" ) ) ) ;
22
26
@@ -138,8 +142,19 @@ static void Main(string[] args)
138
142
}
139
143
catch ( Exception ex )
140
144
{
145
+ Cleanup ( null , null ) ;
141
146
Console . WriteLine ( ex . Message ) ;
142
147
}
148
+ finally
149
+ {
150
+ Cleanup ( null , null ) ;
151
+ }
152
+ }
153
+
154
+ protected static void Cleanup ( object sender , ConsoleCancelEventArgs args )
155
+ {
156
+ Console . ForegroundColor = Program . _savedForegroundColor ;
157
+ Console . CursorVisible = true ;
143
158
}
144
159
145
160
private static void PrintEnvironments ( List < XElement > envs )
You can’t perform that action at this time.
0 commit comments