Revize 9cc42e60
Přidáno uživatelem Eliška Mourycová před téměř 4 roky(ů)
Server/ServerApp/Program.cs | ||
---|---|---|
16 | 16 |
namespace ServerApp |
17 | 17 |
{ |
18 | 18 |
|
19 |
class Config // TBD where this should go
|
|
19 |
class Config |
|
20 | 20 |
{ |
21 | 21 |
public string DataWebsite { get; set; } |
22 | 22 |
public string DownloadedFilesNaming { get; set; } |
... | ... | |
28 | 28 |
public class Program |
29 | 29 |
{ |
30 | 30 |
|
31 |
//public void NotifyUserMessage(string message) |
|
32 |
//{ |
|
33 |
// Console.WriteLine("Received user message: " + message); |
|
34 |
//} |
|
35 |
|
|
36 | 31 |
static void Main(string[] args) |
37 | 32 |
{ |
38 | 33 |
// setup logging service |
... | ... | |
42 | 37 |
Config config = FillConfigInfo(args); |
43 | 38 |
if (config == null) |
44 | 39 |
{ |
40 |
Console.WriteLine("Configuration file parsing failed. Abort."); |
|
45 | 41 |
Console.ReadLine(); |
46 | 42 |
return; |
47 | 43 |
} |
... | ... | |
49 | 45 |
// data download test |
50 | 46 |
DataDownloader dd = DataDownloadAndRetrievalTest(config); |
51 | 47 |
|
52 |
WeatherAsStringTest(dd); |
|
53 |
Console.ReadLine(); |
|
48 |
//WeatherAsStringTest(dd);
|
|
49 |
//Console.ReadLine();
|
|
54 | 50 |
|
55 | 51 |
// xml building test |
56 | 52 |
//XMLTest(); |
... | ... | |
73 | 69 |
Thread inputThread = new Thread(ca.AcceptCommand); |
74 | 70 |
inputThread.Start(); |
75 | 71 |
|
72 |
|
|
76 | 73 |
// connection test |
77 | 74 |
ConnectionTest(controller, config); |
78 | 75 |
|
79 |
Console.ReadLine(); |
|
76 |
//Console.ReadLine();
|
|
80 | 77 |
} |
81 | 78 |
|
82 | 79 |
|
... | ... | |
202 | 199 |
Console.WriteLine("Parsing configuration file..."); |
203 | 200 |
|
204 | 201 |
if (args.Length != 1) |
205 |
Console.WriteLine("Wrong usage of parameters, pass the path to a config file."); // todo better explanation?
|
|
202 |
Console.WriteLine("Wrong usage of parameters, pass only the path to a config file.");
|
|
206 | 203 |
|
207 | 204 |
string fullPathConfig = Path.GetFullPath(args[0]); |
208 | 205 |
string[] lines = null; |
... | ... | |
248 | 245 |
} |
249 | 246 |
} |
250 | 247 |
|
248 |
int parsedPort; |
|
249 |
|
|
250 |
bool success = int.TryParse(extractedConfigInfo.Port, out parsedPort); |
|
251 |
if (!success) |
|
252 |
{ |
|
253 |
Console.WriteLine("Configured port " + extractedConfigInfo.Port + " is not an integer number! Abort."); |
|
254 |
return null; |
|
255 |
} |
|
256 |
|
|
257 |
|
|
251 | 258 |
return extractedConfigInfo; |
252 | 259 |
} |
253 | 260 |
} |
Také k dispozici: Unified diff
Re #9055. Fixed admin commands related bug + refactor + documentation comments