-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathConfig.cs
36 lines (30 loc) · 1.13 KB
/
Config.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
using System;
using System.IO;
using Tommy;
namespace ElectricShimmer
{
static class Config
{
public static void Init()
{
if (File.Exists(configFile))
{
using (StreamReader reader = new StreamReader(File.OpenRead(configFile)))
{
// Parse the table
TomlTable table = TOML.Parse(reader);
if (table.HasKey("Logger"))
LogLevel = (LogLevel)Enum.Parse(typeof(LogLevel), table["Logger"]["LogLevel"]);
if (table.HasKey("AutoUpdate"))
IsUpdateEnabled = table["AutoUpdate"]["enabled"];
if (table.HasKey("cli-wallet"))
CliExecName = table["cli-wallet"]["Name"];
}
}
}
private static string configFile = "config.toml";
public static LogLevel LogLevel { get; private set; } = LogLevel.ALL;
public static bool IsUpdateEnabled { get; private set; } = true;
public static string CliExecName { get; private set; } = "cli-wallet.exe";
}
}