Exemple #1
0
        private void populateDummyData()
        {
            _srWord = "Abrupt";
            _srwEnglishPronunciation = "əˈbrʌpt";
            _srwMarathiPronunciation = "अब्रप्ट";
            DictionaryClass dc = new DictionaryClass();

            dc.setDefinations(new List <String>()
            {
                "sudden and unexpected.", "brief to the point of rudeness; curt.", "steep; precipitous."
            });
            dc.setLanguage(DictionaryClass.Language.English);
            dc.setSentences(new List <String>()
            {
                "I was surprised by the abrupt change of subject.", "you were rather abrupt with that young man"
            });
            switch (Device.RuntimePlatform)
            {
            case Device.Android:
                dc.setImage("abrupt.jpg");
                break;

            default:
                dc.setImage("Images\\abrupt.jpg");
                break;
            }
            DictionaryClass dcm = new DictionaryClass();

            dcm.setSentences(new List <string>()
            {
                "सुहास अनपेक्षित निघून गेला", "अचानक पाऊस पडू लागला", "अकस्मात शब्द का उपयोग प्रेमचंद ने अपनी कहानी", "दिल्लीत कोणताही निर्णय तडकाफडकी होत नाही हे सर्वज्ञात आहे"
            });
            dcm.setLanguage(DictionaryClass.Language.Marathi);
            dcm.setDefinations(new List <string>()
            {
                "अनपेक्षित", "अचानक", "अकस्मात", "तडकाफडकी"
            });

            DictionaryResults = new ObservableCollection <DictionaryClass>()
            {
                dc, dcm
            };
            lblPronunciation.Text = _srwEnglishPronunciation;
            lblWord.Text          = _srWord;
        }
        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);
        }