private static void AppendLicenseExpirationInfo(StringBuilder builder, License license, DateTime now)
        {
            if (LicenseVerificator.IsExpired(license, now))
            {
                builder.AppendFormat("License expired on {0:d}\r\n", license.EndTime);
                return;
            }
            if (!LicenseVerificator.IsStarted(license, now))
            {
                builder.AppendFormat("License will be valid from {0:d}\r\n", license.StartTime);
                return;
            }
            int num = LicenseVerificator.DaysToExpire(license, now);

            if (num <= 30)
            {
                builder.AppendFormat("License expires in {0} day(s)\r\n", num);
                return;
            }
            builder.AppendFormat("License expires on {0:d}\r\n", license.EndTime);
        }
示例#2
0
 public static bool IsValid(License license, DateTime now)
 {
     return(license != null && LicenseVerificator.IsCorrect(license) && LicenseVerificator.IsStarted(license, now) && !LicenseVerificator.IsExpired(license, now) && !LicenseVerificator.IsOutdatedForVersion2x(license));
 }