private static IAppSettings LoadSettings(string file) { var xmlFileLoader = new XmlFileSettingsLoader(Global.GenericDeserializer, Global.PlainConverter); var jsonFileLoader = new JsonFileSettingsLoader(Global.GenericDeserializer, Global.PlainConverter); var iniFileLoader = new IniFileSettingsLoader(Global.GenericDeserializer, Global.PlainConverter); var loader = new SettingsLoader(xmlFileLoader, jsonFileLoader, iniFileLoader); loader.Loaded += (s, e) => { Console.WriteLine("Loaded: {0} ({1})", e.Settings.GetType(), e.Settings.Identity); }; if (Path.GetExtension(file) == ".xml") loader.LoadSettings(xmlFileLoader.LoadFile(Path.Combine("Including", file))); else loader.LoadSettings(jsonFileLoader.LoadFile(Path.Combine("Including", file))); return loader.Settings; }