using System; using Agger.Registro; using Gestor.Common.Helpers; namespace Gestor.Application.Helpers; public class ApplicationHelper { private static string _numeroSerial; private const string ChaveSerial = "NS"; public static string NumeroSerial { get { return _numeroSerial ?? GetSerialNumber(); } set { _numeroSerial = value; } } public static bool Conectado { get; set; } = true; public static bool Beta { get; set; } = false; public static long IdFornecedor { get; set; } public static string Subkey { get; set; } public static DateTime ChecagemVersao { get; set; } = Funcoes.GetNetworkTime(); public static Version Versao { get; set; } internal static string GetSerialNumber() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) try { string text = new RegistryHelper(Subkey).Read("NS", true); NumeroSerial = (string.IsNullOrEmpty(text) ? null : EncryptionHelper.Decrypt(text)); return NumeroSerial; } catch (Exception) { return null; } } }