Пример #1
0
 public static KnowledgeLicense Update(KnowledgeLicense knowledgeLicense, KnowledgeQualities knowledgeQuality)
 {
     if (IsEasyButEarlyToRepeat(knowledgeLicense, knowledgeQuality))
     {
         knowledgeQuality = KnowledgeQualities.StillRemember;
     }
     return(KnowledgeLicenseProviders[knowledgeQuality].Grant(knowledgeLicense));
 }
Пример #2
0
 private static bool IsNotGrantingTime(KnowledgeLicense knowledgeLicense)
 {
     return(knowledgeLicense.RepeatTime > DateTime.UtcNow.AddDays(DAYS_GRANTING_TIMESPAN));
 }
Пример #3
0
 private static bool IsEasyButEarlyToRepeat(KnowledgeLicense knowledgeLicense, KnowledgeQualities knowledgeQuality)
 {
     return(knowledgeQuality.Equals(KnowledgeQualitys.EasyToRemember) && IsNotGrantingTime(knowledgeLicense));
 }