-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathProgram.cs
More file actions
73 lines (62 loc) · 2.45 KB
/
Program.cs
File metadata and controls
73 lines (62 loc) · 2.45 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
using SingleDose.Menus;
using SingleDose.Misc;
using System;
using System.Collections.Generic;
using System.Linq;
namespace SingleDose
{
internal class Program
{
public static string sCurrentMenu = "Main";
static void Main(string[] args)
{
Console.SetWindowSize(149, 36);
Console.Clear();
// Get csc.exe filepaths
SettingsMenu.dAvailableCSCVersions = SettingsMenu.FetchCSCVersions();
// Identify the techniques/APIs/triggers that are available
Reflect.InitializeInterfaces();
if (args.Contains("-t"))
Tutorial.StartTutorial();
else
Start();
}
static void Start()
{
SDConsole.PrintHeader();
SDConsole.PrintSettings(Console.WindowWidth - 59, SDConsole.iConsoleLineNum);
SDConsole.PrintCommandHelp(Console.WindowWidth - 59, SDConsole.iConsoleLineNum+10, sCurrentMenu);
SDConsole.iConsoleLineNum = 0;
List<string> CommandHistory = new List<string>();
while (true)
{
string Command = null;
//Getting the command used to just be Console.ReadLine(), but tab complete seems
//to need a significant amount of code. So it is being implemented from it's own
//dedicated file: SDTabComplete.cs.
Command = SDTabComplete.UseTabComplete(sCurrentMenu, CommandHistory);
if (!String.IsNullOrEmpty(Command))
CommandHistory.Add(Command);
if (!String.IsNullOrEmpty(Command))
{
Console.SetCursorPosition(0, SDConsole.iConsoleLineNum + 1);
switch (sCurrentMenu)
{
case "Main":
MainMenu.CommandHandler(Command);
break;
case "Settings":
SettingsMenu.CommandHandler(Command);
break;
case "Triggers":
TriggersMenu.CommandHandler(Command);
break;
default:
break;
}
}
SDConsole.iConsoleLineNum++;
}
}
}
}