using N2_Patcher.Control;
using System;
using System.Collections.Specialized;
using System.Configuration;

namespace N2_Patcher.Model
{
	internal static class Config
	{
		private readonly static string crypted;

		private readonly static string closeOnStart;

		private readonly static string userAgent;

		private readonly static string voteForCoins;

		private readonly static string homepage;

		private readonly static string discord;

		private readonly static string clientdata;

		private readonly static string patchlist;

		private readonly static string slider;

		private readonly static string stats;

		private readonly static string news;

		private readonly static string update;

		private readonly static string config;

		private readonly static string start;

		static Config()
		{
			Config.crypted = ConfigurationManager.AppSettings.Get("PatchServerSettingsCrypted");
			Config.closeOnStart = ConfigurationManager.AppSettings.Get("CloseOnClientStart");
			Config.userAgent = ".NET Framework Web Application / Patcher Client";
			Config.voteForCoins = ConfigurationManager.AppSettings.Get("Vote4Coins");
			Config.homepage = ConfigurationManager.AppSettings.Get("Homepage");
			Config.discord = ConfigurationManager.AppSettings.Get("Discord");
			Config.clientdata = ConfigurationManager.AppSettings.Get("Clientdata");
			Config.patchlist = ConfigurationManager.AppSettings.Get("Patchlist");
			Config.slider = ConfigurationManager.AppSettings.Get("Slider");
			Config.stats = ConfigurationManager.AppSettings.Get("Stats");
			Config.news = ConfigurationManager.AppSettings.Get("News");
			Config.update = ConfigurationManager.AppSettings.Get("Update");
			Config.config = ConfigurationManager.AppSettings.Get("Config");
			Config.start = ConfigurationManager.AppSettings.Get("Start");
		}

		private static string Get_clear_key(string value)
		{
			string str;
			str = (Config.crypted.ToLower() != "true" ? value : CryptoService.DecryptString(value));
			return str;
		}

		public static string GetClientdata()
		{
			return Config.Get_clear_key(Config.clientdata);
		}

		public static string GetConfigFile()
		{
			return Config.config;
		}

		public static string getDiscord()
		{
			return Config.discord;
		}

		public static string getHomepage()
		{
			return Config.homepage;
		}

		public static string GetNews()
		{
			return Config.Get_clear_key(Config.news);
		}

		public static string GetPatchlist()
		{
			return Config.Get_clear_key(Config.patchlist);
		}

		public static string getPrivateKey()
		{
			return "8Abz9qM4x5ev7nMrWrJZmrRpUsBk37k0SdkL2bq0";
		}

		public static string GetSlider()
		{
			return Config.Get_clear_key(Config.slider);
		}

		public static string GetStartFile()
		{
			return Config.start;
		}

		public static string GetStats()
		{
			return Config.Get_clear_key(Config.stats);
		}

		public static string GetUpdateFile()
		{
			return Config.update;
		}

		public static string getUserAgent()
		{
			return Config.userAgent;
		}

		public static string getVoteForCoins()
		{
			return Config.voteForCoins;
		}

		public static bool isCLoseOnStart()
		{
			return Config.closeOnStart.ToLower() == "true";
		}
	}
}