示例#1
0
        private void loadSmiles()
        {
            try
            {
                using (WebClient webClient = new WebClient())
                {
                    string text = webClient.DownloadString(smilesUrl);

                    JObject emotions = JsonConvert.DeserializeObject <JObject>(text);

                    foreach (JObject emote in emotions["img"])
                    {
                        GamersTVSmile s = new GamersTVSmile();
                        s.Code   = emote["code"].ToString();
                        s.Source = imageUri + emote["src"].ToString();
                        s.Width  = int.Parse(emote["width"].ToString());
                        s.Height = int.Parse(emote["height"].ToString());
                        smiles.Add(emote["code"].ToString(), s);
                    }
                }
            }
            catch (Exception e)
            {
                Debug.Print("Exception on loading smiles: " + e.Message);
            }
        }
示例#2
0
        private void loadSmiles()
        {
            try
            {
                using (WebClient webClient = new WebClient())
                {
                    string text = webClient.DownloadString(smilesUrl);

                    JObject emotions = JsonConvert.DeserializeObject<JObject>(text);

                    foreach (JObject emote in emotions["img"])
                    {
                        GamersTVSmile s = new GamersTVSmile();
                        s.Code = emote["code"].ToString();
                        s.Source = imageUri + emote["src"].ToString();
                        s.Width = int.Parse(emote["width"].ToString());
                        s.Height = int.Parse(emote["height"].ToString());
                        smiles.Add(emote["code"].ToString(), s);
                    }
                }
            }
            catch (Exception e)
            {
                Debug.Print("Exception on loading smiles: " + e.Message);
            }
        }