mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-18 08:23:12 +00:00
cce4707604
Handle all warnings obviously the usage of null! could potentially be avoided if the object init wasn't such garbage, but here we are with years of old junk and lack of abstraction in the GUI project
24 lines
657 B
C#
24 lines
657 B
C#
using System.Configuration;
|
|
using System.IO;
|
|
|
|
namespace PKHeX.WinForms
|
|
{
|
|
public static class ConfigUtil
|
|
{
|
|
public static bool CheckConfig()
|
|
{
|
|
try
|
|
{
|
|
ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal);
|
|
return true;
|
|
}
|
|
catch (ConfigurationErrorsException e)
|
|
{
|
|
var path = (e.InnerException as ConfigurationErrorsException)?.Filename;
|
|
if (path != null && File.Exists(path))
|
|
File.Delete(path);
|
|
return false;
|
|
}
|
|
}
|
|
}
|
|
}
|