Пример #1
0
        public void ShowItem(Point aPoint, PuzzleItem aPuzzleItem)
        {
            Show();
            panelItemHolder_Visual1.PuzzleItems.Clear();
            panelItemHolder_Visual1.RemoveAllFromSelected();



            this.Location = aPoint;
            PuzzleItem aPuzzleItem2 = aPuzzleItem.Clone();

            aPuzzleItem2.SubcatagoryIndex = 0;
            for (int i = 0; i <= aPuzzleItem.SubcatagoryIndexMax; i++)
            {
                panelItemHolder_Visual1.PuzzleItems.Add(aPuzzleItem2.Clone());
                aPuzzleItem2.ToggleSubcatagory();
            }
            panelItemHolder_Visual1.AddToSelected(aPuzzleItem.SubcatagoryIndex);


            panelItemHolder_Visual1.Width = 337 - (4 - aPuzzleItem.SubcatagoryIndexMax) * 64;


            UpdateProperties(aPuzzleItem2);
        }
Пример #2
0
        public static void PopulateWithAllItems(PanelItemHolder holder)
        {
            string[] filePaths = Directory.GetFiles(itemDirectory, "*.bee");
            string[] temp;
            foreach (string path in filePaths)
            {
                if (path.EndsWith(individualItemExtension))
                {
                    temp = path.Split('\\');

                    PuzzleItem aPuzzleItem = new PuzzleItem(temp[temp.Length - 1].Replace(individualItemExtension, ""));
                    //get each subcatagory
                    for (int i = 0; i <= aPuzzleItem.SubcatagoryIndexMax; i++)
                    {
                        holder.InsertBefore(aPuzzleItem.Clone(), 0);
                        aPuzzleItem.ToggleSubcatagory();
                    }
                }
            }
        }