Esempio n. 1
0
 private bool updateImgList(string tagId, string startNos, string tagName)
 {
     try
     {
         LoadingControl(true);
         startNos = (string.IsNullOrEmpty(startNos) ? "1" : startNos);
         List <DuiBaseControl> cItems = new List <DuiBaseControl>();
         foreach (var item in List_Main.Items)
         {
             if (item is DuiBaseControl)
             {
                 if ((item as DuiBaseControl).Name.Contains("imgListBaseControl_"))
                 {
                     cItems.Add((item as DuiBaseControl));
                 }
             }
         }
         foreach (var item in cItems)
         {
             List_Main.Items.Remove(item);
         }
         cItems.Clear();
         var result = new Utils.Response <Entity.MovieListEntity.Root>();
         List <Entity.MovieListEntity.DataItem> imgInfos = new List <Entity.MovieListEntity.DataItem>();
         if (isSearch)
         {
             result.Result = bimg.searchVideoByTag(startNos, tagId, userEntity.imei);
         }
         else
         {
             if (string.IsNullOrEmpty(tagId) || tagId == "新片")
             {
                 result.Result = bimg.getNewVideo(startNos, userEntity.imei);
             }
             else
             {
                 if (string.IsNullOrEmpty(tagName))
                 {
                     result.Result = bimg.getCategoryVideo(startNos, userEntity.imei, tagId);
                 }
             }
         }
         if (result.Result == null || result.Result.data == null || result.Result.data.Count == 0)
         {
             SumPage = startNo;
             LoadingControl(false);
             return(false);
         }
         nCount = result.Result.data.Count.ToString();
         loadPageTextUpdate(startNos, "");
         for (int i = 0; i < result.Result.data.Count; i++)
         {
             int zi = i + 1;
             imgInfos.Add(result.Result.data[i]);
             if (zi % 3 == 0 || zi == result.Result.data.Count)
             {
                 //Thread imgThread = new Thread(() => addImgListThread(imgInfos));
                 //imgThread.Start();
                 List_Main.AddImgList(imgInfos);
                 List_Main.RefreshList();
                 imgInfos.Clear();
             }
         }
         if (result.Result.data.Count <= 0)
         {
             List_Main.addIsNull();
             imgInfos.Clear();
             List_Main.RefreshList();
         }
         LoadingControl(false);
         return(true);
     }
     catch (Exception ex)
     {
         throw new Exception("加载图片失败,原因为:" + ex.Message);
     }
 }
Esempio n. 2
0
        private void getResoult(int pageNo, string strType)
        {
            switch (strType)
            {
            case "版本号":
                updateText("版本号:" + "\r\n" + tvApi.getAppVer().toJsonString() + "\r\n");
                break;

            case "配置":
                updateText("配置:" + "\r\n" + tvApi.getAppConfig(userEntity.imei).toJsonString() + "\r\n");
                break;

            case "购买信息":
                updateText("购买信息:" + "\r\n" + tvApi.getSellInfo(userEntity.sellid).toJsonString() + "\r\n");
                break;

            case "用户登录":
                updateText("用户登录:" + "\r\n" + tvApi.MemberLogin(userEntity).toJsonString() + "\r\n");
                break;

            case "获取分类":
                updateText("获取分类:" + "\r\n" + tvApi.getCategory(userEntity.imei).toJsonString() + "\r\n");
                break;

            case "获取首页菜单分类":
                updateText("获取首页菜单分类:" + "\r\n" + tvApi.getScrollMenu(userEntity.imei).toJsonString() + "\r\n");
                break;

            case "热门标签":
                updateText("热门标签:" + "\r\n" + tvApi.getHotTags("all", userEntity.imei).toJsonString() + "\r\n");
                break;

            case "免费视频":
                updateText("免费视频:" + "\r\n" + tvApi.getFreeVideo(userEntity.imei).toJsonString() + "\r\n");
                break;

            case "最新视频":
                updateText("最新视频:" + "\r\n" + tvApi.getNewVideo(pageNo.ToString(), userEntity.imei).toJsonString() + "\r\n");
                break;

            case "根据类型获取视频":
                updateText("根据类型获取视频:" + "\r\n" + tvApi.getCategoryVideo(pageNo.ToString(), userEntity.imei, text_typeid.Text ?? "11").toJsonString() + "\r\n");
                break;

            case "搜索视频":
                updateText("搜索视频:" + "\r\n" + tvApi.searchVideoByTag(pageNo.ToString(), text_search.Text ?? "", userEntity.imei).toJsonString() + "\r\n");
                break;

            case "视频详情":
                updateText("视频详情:" + "\r\n" + tvApi.getVideoDetail(text_tvid.Text ?? "46446", "44777", userEntity.imei).toJsonString() + "\r\n");
                break;

            case "视频地址":
                avDetail = tvApi.getVideoDetail(text_tvid.Text ?? "46446", "44777", userEntity.imei);
                avPlayer = tvApi.getVideoUrl("", "", text_tvid.Text ?? "46446", "all", userEntity.imei);
                updateText("视频详情:" + "\r\n" + avDetail.toJsonString() + "\r\n");
                updateText("视频地址:" + "\r\n" + avPlayer.toJsonString() + "\r\n");
                break;

            default:
                textBox_resoult.Text = "";
                break;
            }
        }