-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathSKSampleCatalog.cs
50 lines (44 loc) · 1.21 KB
/
SKSampleCatalog.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
38
39
40
41
42
43
44
45
46
47
48
49
50
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Text;
using Terminal.Gui;
namespace SKSampleCatalog
{
class SKSampleCatalogApp
{
static void Main(string[] args)
{
System.Console.OutputEncoding = Encoding.Default;
if (Debugger.IsAttached)
{
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo("en-US");
}
_scenarios = Scenario.GetScenarios();
if (args.Length > 0 && args.Contains("-usc"))
{
_useSystemConsole = true;
args = args.Where(val => val != "-usc").ToArray();
}
// Run the first scenario
if (_scenarios.Count > 0)
{
_selectedScenario = (Scenario)Activator.CreateInstance(_scenarios[1].GetType());
Application.UseSystemConsole = _useSystemConsole;
Application.Init();
_selectedScenario.Init(null);
_selectedScenario.Setup();
_selectedScenario.StartSample();
_selectedScenario.Dispose();
_selectedScenario = null;
Application.Shutdown();
return;
}
}
static List<Scenario> _scenarios;
static Scenario _selectedScenario = null;
static bool _useSystemConsole = false;
}
}