static Globals() { Config = Config.Factory(Assembly.GetCallingAssembly().GetName().Name, false); CurrentDownloadFolder = Config.GetProperty(CurrentDownloadFolderKey, DefaultDownloadFolder, path => PathUtils.IsValidPath(path, PathType.All), CryptAction.Crypt, SettingsSection); CurrentDownloadFileName = Config.GetProperty(CurrentDownloadFileNameKey, DefaultDownloadFileName, path => PathUtils.IsValidPath(path, PathType.LocalFile), CryptAction.Crypt, SettingsSection); LanguageCode = Config.GetProperty(LanguageCodeKey, LocalizationBase.BasicCulture.LCID, SettingsSection); ExistFileRewrite = Config.GetProperty(ExistFileRewriteKey, false, OptionsSection); ConvertSVGToPNG = Config.GetProperty(ConvertSVGToPNGKey, true, OptionsSection); NotStrictAPICheck = Config.GetProperty(NotStrictAPICheckKey, false, OptionsSection); CheckHash = Config.GetProperty(CheckHashKey, false, OptionsSection); QueueAutoDownload = Config.GetProperty(QueueAutoDownloadKey, true, OptionsSection); ForceClose = Config.GetProperty(ForceCloseKey, false, OptionsSection); ProxyAddress = Config.GetProperty(ProxyAddressKey, @"127.0.0.1", NetworkUtils.ValidateIPv4, ProxySection); ProxyPort = Config.GetProperty(ProxyPortKey, 3128, NetworkUtils.ValidatePort, ProxySection); ProxyLogin = Config.GetProperty(ProxyLoginKey, String.Empty, null, CryptAction.Crypt, ProxySection); ProxyPassword = Config.GetProperty(ProxyPasswordKey, String.Empty, null, CryptAction.Crypt, ProxySection); APIKey = Config.GetProperty(APICodeKey, String.Empty, DerpiAPI.CheckAPI, CryptAction.Crypt, null, false, APISection); Localization = new ProgramLocalization(LanguageCode.GetValue()); Logger = new Logger(); WebProxy = null; if (ProxyAddress.IsValid && ProxyAddress.Value != NetworkUtils.LocalhostIP && ProxyPort.IsValid) { WebProxy = ProxyUtils.CreateProxy(ProxyAddress.Value, ProxyPort.Value, ProxyLogin.Value, ProxyPassword.Value); } }