public void LoadLicense() { var dialog = _dialogManager.OpenFileDialog(new FileDialogModel { Filter = "License files (*.xml)|*.xml|All files (*.*)|*.*", FilterIndex = 1 }); var validLicense = false; if (dialog.Result.GetValueOrDefault(false)) { var licenseContent = ReadAllTextWithoutLocking(dialog.FileName); validLicense = licenseManager.TryInstallLicense(licenseContent); } if (validLicense && !LicenseExpirationChecker.HasLicenseExpired(licenseManager.CurrentLicense)) { TryClose(true); } else { //todo: Display error saying that the license was invalid } }
public void LoadLicense() { var dialog = _dialogManager.OpenFileDialog(new FileDialogModel { Filter = "License files (*.xml)|*.xml|All files (*.*)|*.*", FilterIndex = 1 }); if (dialog.Result.GetValueOrDefault(false)) { var licenseContent = ReadAllTextWithoutLocking(dialog.FileName); _licenseManager.Initialize(licenseContent); License = _licenseManager.CurrentLicense; } if (!_licenseManager.TrialExpired && License != null) { TryClose(true); } }