コード例 #1
0
        public static void EnQueue(int productId)
        {
            System.Collections.Generic.IList <int> list = BrowsedProductQueue.GetBrowedProductList();
            int num = 0;

            foreach (int current in list)
            {
                if (productId == current)
                {
                    list.RemoveAt(num);
                    break;
                }
                num++;
            }
            if (list.Count <= 20)
            {
                list.Add(productId);
            }
            else
            {
                list.RemoveAt(0);
                list.Add(productId);
            }
            BrowsedProductQueue.SaveCookie(list);
        }
コード例 #2
0
        public static System.Collections.Generic.IList <int> GetBrowedProductList(int maxNum)
        {
            System.Collections.Generic.IList <int> list = BrowsedProductQueue.GetBrowedProductList();
            int count = list.Count;

            if (list.Count > maxNum)
            {
                for (int i = 0; i < count - maxNum; i++)
                {
                    list.RemoveAt(0);
                }
            }
            return(list);
        }
コード例 #3
0
 public static void ClearQueue()
 {
     BrowsedProductQueue.SaveCookie(null);
 }