コード例 #1
0
ファイル: WordEvent.cs プロジェクト: yu-kopylov/cramtool
 public WordEvent(DateTime eventDate, WordEventType eventType, string translation)
 {
     Contract.Assert(eventDate.Kind == DateTimeKind.Utc);
     EventDate = eventDate;
     EventType = eventType;
     Translation = translation;
 }
コード例 #2
0
 public WordEvent(DateTime eventDate, WordEventType eventType)
 {
     Contract.Assert(eventDate.Kind == DateTimeKind.Utc);
     EventDate   = eventDate;
     EventType   = eventType;
     Translation = null;
 }
コード例 #3
0
        private static WordEvent ConvertToObject(WordEventXml wordEventXml)
        {
            DateTime      eventDate = wordEventXml.EventDate;
            WordEventType eventType = ConvertToObject(wordEventXml.EventType);

            return(new WordEvent(eventDate, eventType, wordEventXml.Translation));
        }
コード例 #4
0
ファイル: WordEvent.cs プロジェクト: yu-kopylov/cramtool
 public WordEvent(DateTime eventDate, WordEventType eventType)
 {
     Contract.Assert(eventDate.Kind == DateTimeKind.Utc);
     EventDate = eventDate;
     EventType = eventType;
     Translation = null;
 }
コード例 #5
0
 public WordEvent(DateTime eventDate, WordEventType eventType, string translation)
 {
     Contract.Assert(eventDate.Kind == DateTimeKind.Utc);
     EventDate   = eventDate;
     EventType   = eventType;
     Translation = translation;
 }
コード例 #6
0
        public void Mark(WordEventType eventType)
        {
            Contract.Assert(eventType != WordEventType.Added || Events.Count == 0);
            Contract.Assert(eventType == WordEventType.Added || Events.Count > 0);

            WordEvent wordEvent = new WordEvent(DateTime.UtcNow, eventType);

            AddEvent(wordEvent);
        }
コード例 #7
0
        public void MarkTranslation(WordEventType eventType, string translation)
        {
            Contract.Assert(eventType != WordEventType.Added);
            Contract.Assert(Events.Count > 0);

            WordEvent wordEvent = new WordEvent(DateTime.UtcNow, eventType, translation);

            AddEvent(wordEvent);
        }
コード例 #8
0
 //todo: is this wrapper required?
 public void Mark(WordEventType eventType)
 {
     foreach (WordInfo word in words)
     {
         if (word.IsStudied)
         {
             word.MarkTranslation(eventType, Translation);
         }
     }
     Update();
 }
コード例 #9
0
 public void Mark(WordList wordList, WordEventType eventType)
 {
     if (WordInfo != null)
     {
         wordList.Mark(WordInfo.Word.Name, eventType);
     }
     if (TranslationInfo != null)
     {
         wordList.MarkTranslation(TranslationInfo.Translation, eventType);
     }
     Result = eventType;
     UpdateState();
 }
コード例 #10
0
        public void MarkTranslation(string translation, WordEventType eventType)
        {
            Contract.Assert(translationsByName.ContainsKey(translation));

            Modified = true;

            TranslationInfo translationInfo = translationsByName[translation];

            translationInfo.Mark(eventType);

            UpdateStats();

            OnContentsChanged();
        }
コード例 #11
0
        public void Mark(string name, WordEventType eventType)
        {
            Contract.Assert(wordsByName.ContainsKey(name));
            Modified = true;

            WordInfo wordInfo = wordsByName[name];

            wordInfo.Mark(eventType);

            UpdateTranslations(wordInfo.Translations);

            UpdateStats();

            OnContentsChanged();
        }
コード例 #12
0
 private static WordEventTypeXml ConvertToXml(WordEventType eventType)
 {
     if (eventType == WordEventType.Added)
     {
         return(WordEventTypeXml.Added);
     }
     if (eventType == WordEventType.Remembered)
     {
         return(WordEventTypeXml.Remembered);
     }
     if (eventType == WordEventType.Forgotten)
     {
         return(WordEventTypeXml.Forgotten);
     }
     throw new Exception(string.Format("Unrecognized eventType: {0}", eventType));
 }
コード例 #13
0
ファイル: Word.cs プロジェクト: yu-kopylov/cramtool
        public void MarkTranslation(WordEventType eventType, string translation)
        {
            Contract.Assert(eventType != WordEventType.Added);
            Contract.Assert(Events.Count > 0);

            WordEvent wordEvent = new WordEvent(DateTime.UtcNow, eventType, translation);
            AddEvent(wordEvent);
        }
コード例 #14
0
 private static WordEventTypeXml ConvertToXml(WordEventType eventType)
 {
     if (eventType == WordEventType.Added)
     {
         return WordEventTypeXml.Added;
     }
     if (eventType == WordEventType.Remembered)
     {
         return WordEventTypeXml.Remembered;
     }
     if (eventType == WordEventType.Forgotten)
     {
         return WordEventTypeXml.Forgotten;
     }
     throw new Exception(string.Format("Unrecognized eventType: {0}", eventType));
 }
コード例 #15
0
ファイル: WordList.cs プロジェクト: yu-kopylov/cramtool
        public void Mark(string name, WordEventType eventType)
        {
            Contract.Assert(wordsByName.ContainsKey(name));
            Modified = true;

            WordInfo wordInfo = wordsByName[name];
            wordInfo.Mark(eventType);

            UpdateTranslations(wordInfo.Translations);

            UpdateStats();

            OnContentsChanged();
        }
コード例 #16
0
ファイル: WordList.cs プロジェクト: yu-kopylov/cramtool
        public void MarkTranslation(string translation, WordEventType eventType)
        {
            Contract.Assert(translationsByName.ContainsKey(translation));

            Modified = true;

            TranslationInfo translationInfo = translationsByName[translation];
            translationInfo.Mark(eventType);

            UpdateStats();

            OnContentsChanged();
        }
コード例 #17
0
ファイル: WordInfo.cs プロジェクト: yu-kopylov/cramtool
 //todo: is this wrapper required?
 public void MarkTranslation(WordEventType eventType, string translation)
 {
     Word.MarkTranslation(eventType, translation);
     Update();
 }
コード例 #18
0
ファイル: Quiz.cs プロジェクト: yu-kopylov/cramtool
 public void MarkCurrentWord(WordEventType eventType)
 {
     CurrentWord.Mark(WordList, eventType);
     UpdateCounts();
 }
コード例 #19
0
ファイル: Word.cs プロジェクト: yu-kopylov/cramtool
        public void Mark(WordEventType eventType)
        {
            Contract.Assert(eventType != WordEventType.Added || Events.Count == 0);
            Contract.Assert(eventType == WordEventType.Added || Events.Count > 0);

            WordEvent wordEvent = new WordEvent(DateTime.UtcNow, eventType);
            AddEvent(wordEvent);
        }
コード例 #20
0
 //todo: is this wrapper required?
 public void Mark(WordEventType eventType)
 {
     foreach (WordInfo word in words)
     {
         if (word.IsStudied)
         {
             word.MarkTranslation(eventType, Translation);
         }
     }
     Update();
 }
コード例 #21
0
 //todo: is this wrapper required?
 public void Mark(WordEventType eventType)
 {
     Word.Mark(eventType);
     Update();
 }
コード例 #22
0
ファイル: Quiz.cs プロジェクト: yu-kopylov/cramtool
 public void MarkCurrentWord(WordEventType eventType)
 {
     CurrentWord.Mark(WordList, eventType);
     UpdateCounts();
 }
コード例 #23
0
 //todo: is this wrapper required?
 public void MarkTranslation(WordEventType eventType, string translation)
 {
     Word.MarkTranslation(eventType, translation);
     Update();
 }
コード例 #24
0
ファイル: WordInfo.cs プロジェクト: yu-kopylov/cramtool
 //todo: is this wrapper required?
 public void Mark(WordEventType eventType)
 {
     Word.Mark(eventType);
     Update();
 }
コード例 #25
0
ファイル: QuizWord.cs プロジェクト: yu-kopylov/cramtool
 public void Mark(WordList wordList, WordEventType eventType)
 {
     if (WordInfo != null)
     {
         wordList.Mark(WordInfo.Word.Name, eventType);
     }
     if (TranslationInfo != null)
     {
         wordList.MarkTranslation(TranslationInfo.Translation, eventType);
     }
     Result = eventType;
     UpdateState();
 }