Exemple #1
0
        private void ClearAllData()
        {
            ItemCategory.SnCache.Clear();

            RegularViewer.ClearData();
            DonorViewer.ClearData();
        }
Exemple #2
0
        private void AddItems(List <WzImageProperty> imgs)
        {
            RegularViewer.SuspendLayout();
            DonorViewer.SuspendLayout();

            foreach (var img in imgs)
            {
                var itemID = img.GetFromPath("ItemId").GetInt();
                var onSale = img.GetFromPath("OnSale")?.GetInt() == 1;
                var donor  = img.GetFromPath("isDonor")?.GetInt() > 0;

                var snImg = img.GetFromPath("SN");
                if (snImg != null)
                {
                    ItemCategory.SnCache.Add(snImg.GetInt());

                    var node = int.Parse(img.Name);
                    if (node > largestNodeValue)
                    {
                        largestNodeValue = node;
                    }
                }

                var image = GetItemImage(itemID);

                if (onSale)
                {
                    if (donor)
                    {
                        DonorViewer.AddItem(itemID, img, image);
                    }
                    else
                    {
                        RegularViewer.AddItem(itemID, img, image);
                    }
                }
            }

            RegularViewer.ResumeLayout();
            DonorViewer.ResumeLayout();
        }