Example #1
0
        private LicenseState LoadAndValidateLicense(string license, out BBSLic bbsLic)
        {
            LicenseState licState = LicenseState.InvalidKey;

            bbsLic = new BBSLic();
            LicErr rc = bbsLic.LoadKeyString(license);

            if (rc == LicErr.OK)
            {
                licState = IsLicenseValid(bbsLic, license);
            }

            return(licState);
        }
Example #2
0
        // Check if the given string is a valid license
        // UI calls this before accepting license string
        public bool IsLicenseStringValid(string license, out LicenseState licState)
        {
            bool bValid = false;

            licState = LicenseState.InvalidKey;

            if (!string.IsNullOrEmpty(license))
            {
                BBSLic lic = new BBSLic();
                LicErr rc  = lic.LoadKeyString(license);
                if (rc == LicErr.OK)
                {
                    licState = IsLicenseValid(lic, license);
                    bValid   = licState == LicenseState.Valid ? true : false;
                }
            }

            return(bValid);
        }
Example #3
0
        // Check if the given string is a valid trial license
        // UI calls this before accepting license string
        public bool IsLicenseStringTrial(string licenseStr)
        {
            bool         bTrial   = false;
            LicenseState licState = LicenseState.InvalidKey;

            if (!string.IsNullOrEmpty(licenseStr))
            {
                BBSLic lic = new BBSLic();
                LicErr rc  = lic.LoadKeyString(licenseStr);
                if (rc == LicErr.OK)
                {
                    licState = IsLicenseValid(lic, licenseStr);
                    if (licState == LicenseState.Valid)
                    {
                        bTrial = lic.IsTrial;
                    }
                }
            }

            return(bTrial);
        }