public void DefaultCreate() { var cfg = new ConfigFile(); Assert.AreEqual("", ConfigFile.GlobalSectionName, "If you changed the global section's name, you also have to update this unit test."); Assert.AreSame(cfg.GlobalSection, cfg[""]); }
public void InitializeFromConfigFile(ConfigFile cfg) { foreach (var opt in cfg["Windows"].Options) { var window = Element.Create(Root, opt.Key, opt.Value.AsConfigFile().GlobalSection) as Window; Debug.Assert(window != null, "non-window in [Windows] section of user interface definition!"); Windows.Add(window); } Game.Events["ui.show"].addListener(OnShowScreen); Game.Events["ui.hide"].addListener(OnHideScreen); Game.Events["ui.close"].addListener(OnClose); }
public ConfigFileParser() { ConfigFile = new ConfigFile(); }
public ConfigFileParser(ConfigFile cfg) { ConfigFile = cfg; }
public static ConfigFile FromString(string content) { var cfg = new ConfigFile(); var parser = new ConfigFileParser(cfg); parser.Parse(content); return cfg; }