Exemple #1
0
        private WordInformationModel GetWordInformationModel(WordInformation wordInfor, string romajiWords, int index)
        {
            string baseForm;
            string reading;
            string pronunciation;
            string conjugation;
            bool   isChecked     = false;
            bool   isInDicionary = false;

            if (wordInfor.IsSymbol() || String.IsNullOrWhiteSpace(wordInfor.Surface))
            {
                reading       = null;
                pronunciation = null;
                baseForm      = null;
                conjugation   = null;
                isChecked     = false;
                isInDicionary = false;
            }
            else
            {
                reading       = wordInfor.Reading;
                pronunciation = romajiWords;
                isInDicionary = wordInfor.IsInDictionary;
                baseForm      = wordInfor.BaseForm;

                var wrodConjugation = wordInfor.Conjugation;
                if (WordInformation.IsHave(wrodConjugation))
                {
                    conjugation = wrodConjugation;
                }
                else
                {
                    conjugation = null;
                }

                if (CurrentSelectedIndex == NO_INDEX && isInDicionary)
                {
                    CurrentSelectedIndex = index;
                    isChecked            = true;
                }
            }

            SolidColorBrush borderColor = GetBorderColor(wordInfor);
            var             word        = new WordInformationModel(wordInfor.Surface, conjugation, baseForm, reading, pronunciation, isInDicionary, isChecked, borderColor);

            word.Index = index;
            return(word);
        }