/// <summary>Reloads the license file and refreshes the status on the main form.</summary> /// <returns>bool</returns> public bool ReloadLicense() { m_License = new SampleLicense(); //Get the Evaluation Encryption envelope warning message. if (m_License.LastError.ErrorNumber == LicenseError.ERROR_PLUS_EVALUATION_WARNING) { m_WarningMessage = "Warning: (" + m_License.LastError.ErrorNumber + ") " + m_License.LastError.ErrorString; } bool successful = m_License.LoadFile(LicenseConfiguration.LicenseFilePath); if (!successful) { successful = m_License.CreateFreshEvaluation(); if (successful) { successful = m_License.LoadFile(LicenseConfiguration.LicenseFilePath); } } if (!successful) { mnuRefreshLicense.Enabled = false; UpdateLicenseStatusProperty(); SplashScreen.InitializeFeatures(m_Features, m_License, false); ToggleFeatures(); return(false); } return(RefreshLicenseStatus()); }
/// <summary>Reloads the license file and refreshes the status on the main form.</summary> public bool ReloadLicense() { m_License = new SampleLicense(); //Get the Evaluation Encryption envelope warning message. if (m_License.LastError.ErrorNumber == LicenseError.ERROR_PLUS_EVALUATION_WARNING) { m_WarningMessage = "Warning: (" + m_License.LastError.ErrorNumber + ") " + m_License.LastError.ErrorString; } bool successful = m_License.LoadFile(LicenseConfiguration.LicenseFilePath); SplashScreen.InitializeFeatures(m_Features, m_License, successful); this.mnuNew.Enabled = newToolStripButton.Enabled = m_Features.CheckStatus(LicenseFeatures.New.ToString()); this.mnuOpen.Enabled = openToolStripButton.Enabled = m_Features.CheckStatus(LicenseFeatures.Open.ToString()); this.mnuPrint.Enabled = printToolStripButton.Enabled = m_Features.CheckStatus(LicenseFeatures.Print.ToString()); this.mnuFind.Enabled = findToolStripButton.Enabled = m_Features.CheckStatus(LicenseFeatures.Find.ToString()); this.mnuSave.Enabled = saveToolStripButton.Enabled = m_Features.CheckStatus(LicenseFeatures.Save.ToString()); this.mnuSelectAll.Enabled = m_Features.CheckStatus(LicenseFeatures.SelectAll.ToString()); this.mnuCut.Enabled = cutToolStripButton.Enabled = m_Features.CheckStatus(LicenseFeatures.Cut.ToString()); this.mnuCopy.Enabled = copyToolStripButton.Enabled = m_Features.CheckStatus(LicenseFeatures.Copy.ToString()); this.mnuPaste.Enabled = pasteToolStripButton.Enabled = m_Features.CheckStatus(LicenseFeatures.Paste.ToString()); this.mnuSaveAs.Enabled = m_Features.CheckStatus(LicenseFeatures.SaveAs.ToString()); this.mnuReplace.Enabled = m_Features.CheckStatus(LicenseFeatures.Replace.ToString()); if (!successful) { m_IsLicenseValid = false; mnuRefreshLicense.Enabled = false; UpdateLicenseStatusProperty(); return(false); } return(RefreshLicenseStatus()); }
/// <summary>Refreshes the license status on the main form</summary> /// <returns>bool</returns> public bool RefreshLicenseStatus() { if (!m_License.IsEvaluation) { mnuRefreshLicense.Enabled = true; } else { mnuRefreshLicense.Enabled = false; } m_IsLicenseValid = m_License.Validate(); //If license is trial and valid license, initializes trial features if (m_License.IsEvaluation && m_IsLicenseValid) { SplashScreen.InitializeTrialFeatures(m_Features, m_License); } else { SplashScreen.InitializeFeatures(m_Features, m_License, m_IsLicenseValid); } ToggleFeatures(); if (!m_IsLicenseValid) { mnuRefreshLicense.Enabled = false; UpdateLicenseStatusProperty(); return(false); } if (m_License.IsEvaluation) { mnuRefreshLicense.Enabled = false; TimeSpan ts = m_License.EffectiveEndDate.ToLocalTime() - DateTime.Now.Date; LicenseStatus = "Evaluation expires in " + Math.Round(ts.TotalDays, 0).ToString() + " days."; return(false); } else { mnuRefreshLicense.Enabled = true; LicenseStatus = "Fully Licensed."; } return(true); }