-
Notifications
You must be signed in to change notification settings - Fork 0
/
ModuleSection.cs
45 lines (34 loc) · 1003 Bytes
/
ModuleSection.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
using System;
using System.Collections.Generic;
namespace oftc_ircd_cs
{
public class ModuleSection : IConfigSection
{
public List<string> Paths { get; private set; }
#region ConfigSection Members
public void SetDefaults()
{
Paths = new List<string>();
}
public void Process(object o)
{
var section = o as Dictionary<string, object>;
if (section == null)
throw new Exception("config element is not an object as expected");
var paths = (List<object>) section["paths"];
foreach (string s in paths)
{
Paths.Add(s);
}
var modules = (Dictionary<string, object>) section["load"];
foreach (var module in modules)
{
Module.Create(module.Key, (string) module.Value);
}
}
public void Verify()
{
}
#endregion
}
}