コード例 #1
0
        private void ShowItems(List <WordModel> items)
        {
            var cellList = new List <LexiconItemViewModel> ();

            foreach (var word in items)
            {
                var item = new LexiconItemViewModel()
                {
                    NewWord       = word.Word,
                    WordMeaning   = word.Meaning,
                    Note          = word.Note,
                    Example       = word.Example,
                    WordFormation = word.WordFormation,
                    ClientId      = word.ClientId,
                    Index         = items.IndexOf(word) + 1,
                    Collocation   = word.Collocation,
                    Synonym       = word.Synonym,
                    Antonym       = word.Antonym
                };

                cellList.Add(item);
            }
            SmartLearningApplication.Instance.LexiconViewModel.LoadDataForlearningStatus(cellList);
            SmartLearningApplication.Instance.LexiconViewModel.ShouldHideFilterModeSegment = true;
            SmartLearningApplication.Instance.ContinueToLexiconView();
        }
コード例 #2
0
        public void ContinueToWordDetailView(LexiconItemViewModel item, List <LexiconItemViewModel> items)
        {
            if (WordDetailViewModel == null)
            {
                WordDetailViewModel = new WordDetailViewModel();
            }

            WordDetailViewModel.Setup(item);

            WordDetailViewModel.currentItem = item;
            WordDetailViewModel.ItemList    = items;

            RunOnUIThread(() => _navigator.NavigateTo <WordDetailViewModel> ());
        }
コード例 #3
0
        public void Setup(LexiconItemViewModel item)
        {
            var wordTypeStr = "";

            switch (item.WordType)
            {
            case 1:
                wordTypeStr = "(noun) ";
                break;

            case 2:
                wordTypeStr = "(verb) ";
                break;

            case 3:
                wordTypeStr = "(adj) ";
                break;

            case 4:
                wordTypeStr = "(adv) ";
                break;

            default:
                wordTypeStr = "";
                break;
            }
            NewWord       = item.NewWord + " " + wordTypeStr;
            WordMeaning   = item.WordMeaning;
            Note          = (!string.IsNullOrEmpty(item.Note)) ? item.Note : "Update now!";
            Example       = (!string.IsNullOrEmpty(item.Example)) ? item.Example : "Update now!";
            Collocation   = (!string.IsNullOrEmpty(item.Collocation)) ? item.Collocation : "Update now!";
            Synonym       = (!string.IsNullOrEmpty(item.Synonym)) ? item.Synonym : "Update now!";
            Antonym       = (!string.IsNullOrEmpty(item.Antonym)) ? item.Antonym : "Update now!";
            WordFormation = (!string.IsNullOrEmpty(item.WordFormation)) ? item.WordFormation : "Update now!";
            WordType      = item.WordType;
        }
コード例 #4
0
        private void ShowResult()
        {
            if (learningWords == null || learningWords.Count <= 0)
            {
                return;
            }

            var word = learningWords [Index];

            //Update database if ViewMode = SupperMemo Mode
            if (learningMode == LearningMode.SupperMemo)
            {
                SupperMemo.Reset(word);
                UpdateDatabase(word);
            }

            //---- Create vars for WordDetailView
            var itemViewModel = new LexiconItemViewModel()
            {
                ClientId      = word.ClientId,
                NewWord       = word.Word,
                WordMeaning   = word.Meaning,
                Note          = word.Note,
                Example       = word.Example,
                Antonym       = word.Antonym,
                Synonym       = word.Synonym,
                WordFormation = word.WordFormation
            };

            var items = new List <LexiconItemViewModel> ();

            foreach (var item in learningWords)
            {
                var itemModel = new LexiconItemViewModel()
                {
                    ClientId      = item.ClientId,
                    NewWord       = item.Word,
                    WordMeaning   = item.Meaning,
                    Note          = item.Note,
                    Example       = item.Example,
                    Antonym       = item.Antonym,
                    Synonym       = item.Synonym,
                    WordFormation = item.WordFormation
                };
                items.Add(itemModel);
            }

            SmartLearningApplication.Instance.ContinueToWordDetailView(itemViewModel, items);

            Index++;

            // If this word is last word then repeat
            if (Index == learningWords.Count)
            {
                Index = 0;
            }

            WordMeaning = WordMeaningStr(learningWords [Index]);

            NewWord = "";

            ShoudLoadData = false;
        }