Beispiel #1
0
        private void addBackImg()
        {
            LoadingControl(true);
            var result = new Utils.Response <Entity.MovieListEntity.Root>();
            var rType  = new Utils.Response <Entity.MenuEntity.Root>();

            try
            {
                rType.Result = bimg.getScrollMenu(userEntity.imei);
                //添加分类控件
                addImgType(rType.Result);
                //添加详细信息
                List <Entity.MovieListEntity.DataItem> imgInfos = new List <Entity.MovieListEntity.DataItem>();
                result.Result = bimg.getNewVideo(startNo, userEntity.imei);
                if (result.Result == null)
                {
                    LoadingControl(false);
                    return;
                }
                nCount = result.Result.data.Count.ToString();
                loadPageTextUpdate(startNo, "");
                List_Main.userEntity = userEntity;
                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)
                    {
                        List_Main.AddImgList(imgInfos);
                        List_Main.RefreshList();
                        imgInfos.Clear();
                    }
                }
                LoadingControl(false);
            }
            catch (Exception ex)
            {
                result.Code    = 500;
                result.Message = ex.Message;
                throw ex;
            }
        }
Beispiel #2
0
        private bool addImgListItem(string tagId, string startNos)
        {
            LoadingControl(true);
            //准备加载下一页图片
            startNos = (string.IsNullOrEmpty(startNos) ? "1" : startNos);
            List <DuiBaseControl> cItems = new List <DuiBaseControl>();
            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 == "0")
                {
                    result.Result = bimg.getNewVideo(startNos, userEntity.imei);
                }
                else
                {
                    result.Result = bimg.getCategoryVideo(startNos, userEntity.imei, tagId);
                }
            }
            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)
                {
                    List_Main.AddImgList(imgInfos);
                    List_Main.RefreshList();
                    imgInfos.Clear();
                }
            }
            LoadingControl(false);
            isLoadData = false;
            return(true);
        }
Beispiel #3
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);
     }
 }