-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSetting.cs
65 lines (55 loc) · 1.76 KB
/
Setting.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using Sync.Tools;
using Sync.Tools.ConfigurationAttribute;
namespace OsuDataDistributeRestful
{
public class SettingIni : IConfigurable
{
[Bool(RequireRestart = true)]
public ConfigurationElement AllowLAN
{
set => Setting.AllowLAN = bool.Parse(value);
get => Setting.AllowLAN.ToString();
}
[Bool(RequireRestart = true)]
public ConfigurationElement EnableFileHttpServer
{
set => Setting.EnableFileHttpServer = bool.Parse(value);
get => Setting.EnableFileHttpServer.ToString();
}
[Path(IsDirectory = true)]
public ConfigurationElement FileServerRootPath
{
set => Setting.FileServerRootPath = value;
get => Setting.FileServerRootPath;
}
[Integer(MinValue = 5000, MaxValue = 65535, RequireRestart = true)]
public ConfigurationElement ApiPort
{
set => Setting.ApiPort = int.Parse(value);
get => Setting.ApiPort.ToString();
}
[Integer(MinValue = 5000, MaxValue = 65535, RequireRestart = true)]
public ConfigurationElement FilePort
{
set => Setting.FilePort = int.Parse(value);
get => Setting.FilePort.ToString();
}
public void onConfigurationLoad()
{
}
public void onConfigurationReload()
{
}
public void onConfigurationSave()
{
}
}
internal static class Setting
{
public static bool AllowLAN = false;
public static bool EnableFileHttpServer = false;
public static string FileServerRootPath = @"..\html";
public static int ApiPort = 10800;
public static int FilePort = 10801;
}
}