コード例 #1
0
        public void DoSearch(byte type, int searchResCount, string searchName)
        {
            try
            {
                SearchResCount = searchResCount;
            }
            catch
            {
                SearchResCount = 20;
            }
            switch (type)
            {
            case 0:
                sppos    = new SteamLibrary.SearchPagePos(0, 1);
                lastSrch = searchName;
                break;

            case 1:
                if (sppos.CurrentPos < sppos.PageCount)
                {
                    sppos.CurrentPos += SearchResCount;
                }
                else
                {
                    sppos.CurrentPos = 1;
                }

                break;

            case 2:
                if (sppos.CurrentPos > SearchResCount)
                {
                    sppos.CurrentPos -= SearchResCount;
                }
                else
                {
                    sppos.CurrentPos = sppos.PageCount;
                }
                break;

            default:
                break;
            }

            //search/render/?query={0}&start={1}&count={2}
            linkTxt = string.Format(SteamLibrary._search, lastSrch, sppos.CurrentPos - 1, SearchResCount);
            SearchThreadExcute();
        }
コード例 #2
0
        public void DoAdvanceSearch(byte type, int searchResCount, string searchName, bool isGame, string game,
                                    bool isMin, string min, bool isMax, string max)
        {
            switch (type)
            {
            case 0:
                sppos    = new SteamLibrary.SearchPagePos(0, 1);
                lastSrch = searchName;
                break;

            case 1:
                if (sppos.CurrentPos < sppos.PageCount)
                {
                    sppos.CurrentPos += searchResCount;
                }
                else
                {
                    sppos.CurrentPos = 1;
                }

                break;

            case 2:
                if (sppos.CurrentPos > searchResCount)
                {
                    sppos.CurrentPos -= searchResCount;
                }
                else
                {
                    sppos.CurrentPos = sppos.PageCount;
                }
                break;

            default:
                break;
            }

            //search/render/?appid={0}&query={0}&start={1}&count={2}
            advancelinkTxt = string.Format(SteamLibrary._adsearch, SteamLibrary.GetApp(game).AppID, lastSrch, sppos.CurrentPos - 1, searchResCount);
            ThreadPool.QueueUserWorkItem(new WaitCallback(AdvanceSearchProgress), new object[]
                                         { isGame, game, isMin, min, isMax, max, searchResCount });
        }