public void ChangeOrderMode(int orderBy)
        {
            if (this.orderBy == (OrderByModes)orderBy)
                return;

            this.orderBy = (OrderByModes)orderBy;
            GetPage(page);
        }
示例#2
0
        public void ChangeOrderMode(int orderBy)
        {
            if (this.orderBy == (OrderByModes)orderBy)
            {
                return;
            }

            this.orderBy = (OrderByModes)orderBy;
            GetPage(page);
        }
示例#3
0
        IEnumerator DownloadPage(int page, OrderByModes orderBy)
        {
            loading.SetStatus(string.Format("Loading Page {0}", page + 1), "", true);
            WWW www = new WWW(string.Format("{0}{1}?page={2}&size={3}&order={4}", CowsButtUrl, getList, page, pageSize, orderBy.ToString()));

            urlText.text = www.url;
            yield return(www);

            if (www.error != null)
            {
                Debug.LogError(www.error);
                loading.SetStatus("Loading Error", string.Format("Loading Page {0} Failed!{2}Error: <color=red>{1}</color>{2}<size=12>URL: {3}</size>", page + 1, www.error, System.Environment.NewLine, www.url), false);
            }
            else
            {
                yield return(1);

                pageData = JsonConvert.DeserializeObject <PageData>(www.text);
                yield return(1);

                DownloadPage_Complete();
                loading.Hide();
            }
        }
 IEnumerator DownloadPage(int page,OrderByModes orderBy)
 {
     loading.SetStatus(string.Format("Loading Page {0}", page + 1), "", true);
     WWW www = new WWW(string.Format("{0}{1}?page={2}&size={3}&order={4}", CowsButtUrl, getList, page, pageSize,orderBy.ToString()));
     urlText.text = www.url;
     yield return www;
     if (www.error != null)
     {
         Debug.LogError(www.error);
         loading.SetStatus("Loading Error", string.Format("Loading Page {0} Failed!{2}Error: <color=red>{1}</color>{2}<size=12>URL: {3}</size>",page+1,www.error,System.Environment.NewLine,www.url), false);
     }
     else
     {
         yield return 1;
         pageData = JsonConvert.DeserializeObject<PageData>(www.text);
         yield return 1;
         DownloadPage_Complete();
         loading.Hide();
     }
 }