Add --port option to samples

Fixes #6
This commit is contained in:
Frank A. Krueger 2017-06-18 18:42:28 -07:00
parent 0b4b54ffbf
commit c6979c1d63
1 changed files with 16 additions and 0 deletions

View File

@ -7,6 +7,22 @@ namespace Samples
{ {
static void Main (string[] args) static void Main (string[] args)
{ {
for (var i = 0; i < args.Length; i++) {
var a = args[i];
switch (args[i]) {
case "-p" when i + 1 < args.Length:
case "--port" when i + 1 < args.Length:
{
int p;
if (int.TryParse (args[i + 1], out p)) {
UI.Port = p;
}
i++;
}
break;
}
}
new ButtonSample ().Publish (); new ButtonSample ().Publish ();
new TodoSample ().Publish (); new TodoSample ().Publish ();