Ejemplo n.º 1
0
        public List <String> getStringList()
        {
            List <String>  words   = new List <string>();
            IList <JToken> results = allObjects["dictionary"]["words"]["word"].Children().ToList();

            foreach (JToken jt in results)
            {
                WordInformation wi = jt.ToObject <WordInformation>();
                words.Add(wi.Word);
            }

            return(words);
        }
Ejemplo n.º 2
0
        private void populateData(String word)
        {
            _dd.setSearchWord(word);

            WordInformation wi = _dd.getInformation();

            DictionaryClass dce = new DictionaryClass();

            DictionaryClass dcm = new DictionaryClass();

            _srWord = wi.Word;
            _srwEnglishPronunciation = wi.EPronunciation;
            if (wi.MPronunciation == "null")
            {
                _srwMarathiPronunciation = "";
            }
            else
            {
                _srwMarathiPronunciation = wi.MPronunciation;
            }
            lblPronunciation.Text = _srwEnglishPronunciation;
            lblWord.Text          = _srWord;

            if (wi.IsEnglish)
            {
                dce.addDefinations(_dd.getDefinations());
                dcm.addDefinations(_dd.getTranslations());

                if (wi.ImageUrl != "null")
                {
                    switch (Device.RuntimePlatform)
                    {
                    case Device.Android:
                        dce.setImage(wi.ImageUrl);
                        break;

                    default:
                        dce.setImage("Images\\" + wi.ImageUrl);
                        break;
                    }
                }
            }
            else
            {
                dce.addDefinations(_dd.getTranslations());
                dcm.addDefinations(_dd.getDefinations());

                if (wi.ImageUrl != "null")
                {
                    switch (Device.RuntimePlatform)
                    {
                    case Device.Android:
                        dcm.setImage(wi.ImageUrl);
                        break;

                    default:
                        dcm.setImage("Images\\" + wi.ImageUrl);
                        break;
                    }
                }
            }

            dcm.setLanguage(DictionaryClass.Language.Marathi);
            dce.setLanguage(DictionaryClass.Language.English);

            DictionaryResults = new ObservableCollection <DictionaryClass>()
            {
                dce, dcm
            };
            cvResults.ItemsSource = DictionaryResults;
            stResult.ScaleTo(1);
        }