public static LicenseSourceResult Validate(string licenseText)
        {
            var source       = new LicenseDialogSource(licenseText);
            var sourceResult = source.Find("ServiceInsight");

            if (sourceResult.License != null && sourceResult.License.HasExpired())
            {
                sourceResult.Result = "The selected license is expired";
            }

            return(sourceResult);
        }
        public LicenseInstallationResult TryInstallLicense(string licenseText)
        {
            ValidationResult = LicenseDialogSource.Validate(licenseText);
            if (ValidationResult.License != null)
            {
                if (ValidationResult.License.HasExpired())
                {
                    return(LicenseInstallationResult.Expired);
                }

                new RegistryLicenseStore().StoreLicense(licenseText);
                new FilePathLicenseStore().StoreLicense(LicenseFileLocationResolver.GetPathFor(Environment.SpecialFolder.LocalApplicationData), licenseText);

                CurrentLicense = ValidationResult.License;

                return(LicenseInstallationResult.Succeeded);
            }

            LogTo.Warning($"Can't install license: {ValidationResult.Result}");

            return(LicenseInstallationResult.Failed);
        }