public static void Initialize(Config config) { conn = new MySqlConnection( String.Format("Server={0};Port={1};Database={2};Uid={3};Pwd={4};", config.DatabaseHost, config.DatabasePort, config.DatabaseName, config.DatabaseUser, config.DatabasePassword)); }
public static Config Load(string path = "config.json") { Config config; if (File.Exists(configPath)) { Log.WriteLine("Config file exists, loading."); string json = File.ReadAllText(configPath); config = JsonConvert.DeserializeObject<Config>(json); } else { Log.WriteLine("Config file could not be found, creating."); config = new Config(); config.Save(); } return config; }