コード例 #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));
 }