public void GetAttributes(JObject feedsJObject) { type = feedsJObject["type"].ToString(); content = feedsJObject["content"].ToString(); article_content = feedsJObject["article_content"].ToString(); created_time = feedsJObject["created_time"].ToString(); article_id = feedsJObject["article_id"].ToString(); stunum = feedsJObject["stunum"].ToString(); nickname = feedsJObject["nickname"].ToString(); photo_src = feedsJObject["photo_src"].ToString() == "" ? "ms-appx:///Assets/Boy-100.png" : feedsJObject["photo_src"].ToString(); string articlephotos = feedsJObject["article_photo_src"].ToString(); //string picstart = "http://hongyan.cqupt.edu.cn/cyxbsMobile/Public/photo/"; if (articlephotos != "") { try { string[] i = articlephotos.Split(new char[] { ',' }, 9); if (articlephotos.EndsWith(",")) article_photo_src = new Img[i.Length - 1]; else article_photo_src = new Img[i.Length]; for (int j = 0; j < article_photo_src.Length; j++) { if (i[j] != "") { if (!i[j].StartsWith(App.picstart)) { article_photo_src[j] = new Img(); article_photo_src[j].ImgSrc = App.picstart + i[j]; article_photo_src[j].ImgSmallSrc = App.picstartsmall + i[j]; } else { article_photo_src[j] = new Img(); article_photo_src[j].ImgSrc = i[j]; article_photo_src[j].ImgSmallSrc = i[j]; } } else { article_photo_src[j] = new Img(); article_photo_src[j].ImgSrc = article_photo_src[j].ImgSmallSrc = ""; } } } catch (Exception e) { Debug.WriteLine(e.Message); } } }
public void GetAttributes(JObject feedsJObject) { title = feedsJObject["title"].ToString(); id = feedsJObject["id"].ToString(); num_id = "5" + feedsJObject["type_id"].ToString() + feedsJObject["id"].ToString(); type_id = feedsJObject["type_id"].ToString(); content = feedsJObject["content"].ToString(); updated_time = feedsJObject["updated_time"].ToString(); created_time = feedsJObject["created_time"].ToString(); like_num = feedsJObject["like_num"].ToString(); remark_num = feedsJObject["remark_num"].ToString(); nickname = feedsJObject["nickname"].ToString(); stunum = feedsJObject["stunum"].ToString(); photo_src = feedsJObject["photo_src"].ToString() == "" ? "ms-appx:///Assets/Community_nohead.png" : feedsJObject["photo_src"].ToString(); photo_thumbnail_src = feedsJObject["photo_thumbnail_src"].ToString() == "" ? "ms-appx:///Assets/Community_nohead.png" : feedsJObject["photo_thumbnail_src"].ToString(); //photo_src = "ms-appx:///Assets/Community_nohead.png"; //photo_thumbnail_src = "ms-appx:///Assets/Community_nohead.png"; is_my_like = feedsJObject["is_my_like"].ToString(); string articlephotos = feedsJObject["article_photo_src"].ToString(); if (articlephotos != "") { try { string[] i = articlephotos.Split(new char[] { ',' }, 9); if (articlephotos.EndsWith(",")) { article_photo_src = new Img[i.Length - 1]; } else { article_photo_src = new Img[i.Length]; } for (int j = 0; j < article_photo_src.Length; j++) { if (i[j] != "") { if (!i[j].StartsWith(App.picstart)) { article_photo_src[j] = new Img(); article_photo_src[j].ImgSrc = App.picstart + i[j]; article_photo_src[j].ImgSmallSrc = App.picstartsmall + i[j]; } else { article_photo_src[j] = new Img(); article_photo_src[j].ImgSrc = i[j]; article_photo_src[j].ImgSmallSrc = i[j]; } } else { article_photo_src[j] = new Img(); article_photo_src[j].ImgSrc = article_photo_src[j].ImgSmallSrc = ""; } } } catch (Exception e) { Debug.WriteLine(e.Message); } } //if (UserHead == "") //{ // UserHead = "ms-appx:///Assets/Boy-100.png"; // Debug.WriteLine("---没有头像---"); //} //Time = feedsJObject["time"].ToString(); //Content = feedsJObject["content"].ToString(); //LikeNum = int.Parse(feedsJObject["like_num"].ToString()); //IsMyLike = feedsJObject["is_my_Like"].ToString(); //CommentNum = int.Parse(feedsJObject["remark_num"].ToString()); //try //{ // JArray imgs = (JArray)feedsJObject["img"]; // Imgs = new Img[imgs.Count]; // for (int i = 0; i < imgs.Count; i++) // { // Imgs[i] = new Img(); // Imgs[i].GetAttributes((JObject)imgs[i]); // } //} //catch (InvalidCastException) //{ // JObject img = (JObject)feedsJObject["img"]; // Imgs = new Img[1]; // Imgs[0] = new Img(); // Imgs[0].GetAttributes(img); //} }
public void GetAttributes(JObject feedsJObject) { title = feedsJObject["title"].ToString(); id = feedsJObject["id"].ToString(); num_id = "5" + feedsJObject["type_id"].ToString() + feedsJObject["id"].ToString(); type_id = feedsJObject["type_id"].ToString(); content = feedsJObject["content"].ToString(); updated_time = feedsJObject["updated_time"].ToString(); created_time = feedsJObject["created_time"].ToString(); like_num = feedsJObject["like_num"].ToString(); remark_num = feedsJObject["remark_num"].ToString(); nickname = feedsJObject["nickname"].ToString(); stunum = feedsJObject["stunum"].ToString(); photo_src = feedsJObject["photo_src"].ToString() == "" ? "ms-appx:///Assets/Community_nohead.png" : feedsJObject["photo_src"].ToString(); photo_thumbnail_src = feedsJObject["photo_thumbnail_src"].ToString() == "" ? "ms-appx:///Assets/Community_nohead.png" : feedsJObject["photo_thumbnail_src"].ToString(); //photo_src = "ms-appx:///Assets/Community_nohead.png"; //photo_thumbnail_src = "ms-appx:///Assets/Community_nohead.png"; is_my_like = feedsJObject["is_my_like"].ToString(); string articlephotos = feedsJObject["article_photo_src"].ToString(); if (articlephotos != "") { try { string[] i = articlephotos.Split(new char[] { ',' }, 9); if (articlephotos.EndsWith(",")) article_photo_src = new Img[i.Length - 1]; else article_photo_src = new Img[i.Length]; for (int j = 0; j < article_photo_src.Length; j++) { if (i[j] != "") { if (!i[j].StartsWith(App.picstart)) { article_photo_src[j] = new Img(); article_photo_src[j].ImgSrc = App.picstart + i[j]; article_photo_src[j].ImgSmallSrc = App.picstartsmall + i[j]; } else { article_photo_src[j] = new Img(); article_photo_src[j].ImgSrc = i[j]; article_photo_src[j].ImgSmallSrc = i[j]; } } else { article_photo_src[j] = new Img(); article_photo_src[j].ImgSrc = article_photo_src[j].ImgSmallSrc = ""; } } } catch (Exception e) { Debug.WriteLine(e.Message); } } //if (UserHead == "") //{ // UserHead = "ms-appx:///Assets/Boy-100.png"; // Debug.WriteLine("---没有头像---"); //} //Time = feedsJObject["time"].ToString(); //Content = feedsJObject["content"].ToString(); //LikeNum = int.Parse(feedsJObject["like_num"].ToString()); //IsMyLike = feedsJObject["is_my_Like"].ToString(); //CommentNum = int.Parse(feedsJObject["remark_num"].ToString()); //try //{ // JArray imgs = (JArray)feedsJObject["img"]; // Imgs = new Img[imgs.Count]; // for (int i = 0; i < imgs.Count; i++) // { // Imgs[i] = new Img(); // Imgs[i].GetAttributes((JObject)imgs[i]); // } //} //catch (InvalidCastException) //{ // JObject img = (JObject)feedsJObject["img"]; // Imgs = new Img[1]; // Imgs[0] = new Img(); // Imgs[0].GetAttributes(img); //} }
public void GetAttributes(JObject feedsJObject) { id = feedsJObject["id"].ToString(); type = feedsJObject["type"].ToString(); if (type != "bbdd" && type != "notice") { nick_name = feedsJObject["user_name"].ToString(); } else { nick_name = feedsJObject["nick_name"].ToString(); } type_id = feedsJObject["type_id"].ToString(); article_id = feedsJObject["article_id"].ToString(); num_id = "1" + feedsJObject["type_id"].ToString() + feedsJObject["article_id"].ToString(); user_id = feedsJObject["user_id"].ToString(); if (type == "jwzx") { user_head = "ms-appx:///Assets/Community_JWZX.png"; } else if (type == "cyxw") { user_head = "ms-appx:///Assets/Community_CYXW.png"; } else if (type == "xsjz") { user_head = "ms-appx:///Assets/Community_XSJZ.png"; } else if (type == "xwgg") { user_head = "ms-appx:///Assets/Community_XWGG.png"; } else { user_head = feedsJObject["user_head"].ToString() == "" ? "ms-appx:///Assets/Community_nohead.png" : feedsJObject["user_head"].ToString(); } time = feedsJObject["time"].ToString(); like_num = feedsJObject["like_num"].ToString(); remark_num = feedsJObject["remark_num"].ToString(); is_my_Like = feedsJObject["is_my_Like"].ToString(); HotFeedsContentBase h = new HotFeedsContentBase(); h.GetAttributes((JObject)feedsJObject["content"]); content = h; JObject imgs = (JObject)feedsJObject["img"]; string imgsurls = imgs["img_src"].ToString(); if (imgsurls != "") { try { string[] i = imgsurls.Split(new char[] { ',' }, 9); if (imgsurls.EndsWith(",")) { img = new Img[i.Length - 1]; } else { img = new Img[i.Length]; } for (int j = 0; j < img.Length; j++) { if (i[j] != "") { if (!i[j].StartsWith(App.picstart)) { img[j] = new Img(); img[j].ImgSrc = App.picstart + i[j]; img[j].ImgSmallSrc = App.picstartsmall + i[j]; } else { img[j] = new Img(); img[j].ImgSrc = i[j]; img[j].ImgSmallSrc = i[j]; } } else { img[j] = new Img(); img[j].ImgSrc = img[j].ImgSmallSrc = ""; } } } catch (Exception e) { Debug.WriteLine(e.Message); } } }
public void GetAttributes(JObject feedsJObject, bool myfeed = false) { id = feedsJObject["id"].ToString(); content = feedsJObject["content"].ToString(); type_id = feedsJObject["type_id"].ToString(); created_time = feedsJObject["created_time"].ToString(); updated_time = feedsJObject["updated_time"].ToString(); like_num = feedsJObject["like_num"].ToString(); remark_num = feedsJObject["remark_num"].ToString(); string articlephotos = feedsJObject["photo_src"].ToString(); string smallphotos = feedsJObject["thumbnail_src"].ToString(); if (myfeed) { nickname = feedsJObject["nickname"].ToString(); headimg = feedsJObject["user_photo"].ToString(); } else { nickname = appSetting.Values["Community_nickname"].ToString(); headimg = appSetting.Values["Community_headimg_src"].ToString(); } if (articlephotos != "") { try { string[] i = articlephotos.Split(new char[] { ',' }, 9); if (articlephotos.EndsWith(",")) { photo_src = new Img[i.Length - 1]; } else { photo_src = new Img[i.Length]; thumbnail_src = new Img[i.Length]; } for (int j = 0; j < photo_src.Length; j++) { if (i[j] != "") { if (!i[j].StartsWith(App.picstart)) { photo_src[j] = new Img(); photo_src[j].ImgSrc = App.picstart + i[j]; photo_src[j].ImgSmallSrc = App.picstartsmall + i[j]; } else { photo_src[j] = new Img(); photo_src[j].ImgSrc = i[j]; photo_src[j].ImgSmallSrc = i[j]; } } else { photo_src[j] = new Img(); photo_src[j].ImgSrc = photo_src[j].ImgSmallSrc = ""; } } } catch (Exception e) { Debug.WriteLine(e.Message); } } }