/// <summary> /// Checks whether the specified configuration is valid and can be used. /// If the configurationnis invalid, an appropiate exception is thrown. /// Otherwise, the function simply returns. /// </summary> /// <param name="config"> /// The <see cref="Configuration"/> object to check. /// </param> private static void CheckSettings(Configuration config) { if (!Directory.Exists(config.BaseDir)) { string foundDir = FindBaseDir(); if (foundDir != null && Directory.Exists(foundDir)) config.BaseDir = foundDir; else throw new Exception("No screenshot folder has been set."); } config.Save(); }