Ejemplo n.º 1
0
        /// <summary>Reloads the license file and refreshes the status on the main form.</summary>
        internal void ReloadLicense()
        {
            if (!m_License.LoadFile(LicenseConfiguration.LicenseFilePath))
            {
                if (m_License.LastError.ErrorNumber == LicenseError.ERROR_PLUS_EVALUATION_INVALID)
                {
                    //Invalid Protection PLUS 5 SDK evaluation envelope.
                    statusTextLabel.Text           = m_License.LastError.ErrorString;
                    activateButton.Enabled         = false;
                    activateManuallyButton.Enabled = false;
                    refreshLicenseButton.Enabled   = false;
                    deactivateButton.Enabled       = false;
                    return;
                }

                if (!m_License.CreateFreshEvaluation())
                {
                    statusTextLabel.Text = "Invalid.  " + m_License.LastError.ErrorString;
                    return;
                }
                else
                {
                    if (!m_License.LoadFile(LicenseConfiguration.LicenseFilePath))
                    {
                        statusTextLabel.Text = "Invalid.  " + m_License.LastError.ErrorString;
                        return;
                    }
                }
            }

            RefreshLicenseStatus();
        }
Ejemplo n.º 2
0
        /// <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());
        }