Пример #1
0
        void DisplayLicenseStatus(bool appStartCheck)
        {
            var license = licenseManager.CurrentLicense;

            if (license == null)
            {
                return;
            }

            StatusBarManager.LicenseStatus.AppStartCheck = appStartCheck;

            if (license.IsCommercialLicense)
            {
                var upgradeProtectionDays = licenseManager.GetUpgradeProtectionRemainingDays();
                var expirationDays        = licenseManager.GetExpirationRemainingDays();

                if (upgradeProtectionDays.HasValue)
                {
                    StatusBarManager.LicenseStatus.SetLicenseUpgradeProtectionDays(upgradeProtectionDays.Value);
                }

                if (expirationDays.HasValue)
                {
                    StatusBarManager.LicenseStatus.SetLicenseRemainingDays(expirationDays.Value);
                }
            }
            else
            {
                StatusBarManager.LicenseStatus.SetTrialRemainingDays(licenseManager.GetRemainingTrialDays());
            }
        }
Пример #2
0
        private void ShowLicenseStatus()
        {
            var currentLicense = licenseManager.CurrentLicense;

            if (currentLicense == null)
            {
                return;
            }

            LicenseType = currentLicense.IsTrialLicense ? currentLicense.LicenseType : string.Format($"{currentLicense.LicenseType}, {currentLicense.Edition}");

            if (currentLicense.IsCommercialLicense)
            {
                UpgradeProtectionExpirationDate = currentLicense.UpgradeProtectionExpiration;
                ExpirationDate = currentLicense.ExpirationDate;
            }
            else
            {
                UpgradeProtectionExpirationDate = null;
                ExpirationDate = currentLicense.ExpirationDate;
            }

            if (currentLicense.IsCommercialLicense)
            {
                var expirationDaysLeft = licenseManager.GetExpirationRemainingDays();
                ExpirationDateStatus    = licenseManager.GetExpirationStatus();
                ExpirationRemainingDays = expirationDaysLeft.HasValue && expirationDaysLeft.Value > 0 ? expirationDaysLeft.Value : 0;

                var upgradeDaysLeft = licenseManager.GetUpgradeProtectionRemainingDays();
                UpgradeProtectionDateStatus    = licenseManager.GetUpgradeProtectionStatus();
                UpgradeProtectionRemainingDays = upgradeDaysLeft.HasValue && upgradeDaysLeft.Value > 0 ? upgradeDaysLeft.Value : 0;
            }
            else
            {
                ExpirationRemainingDays = licenseManager.GetRemainingTrialDays();
                ExpirationDateStatus    = licenseManager.GetTrialExpirationStatus();
            }
        }