Beispiel #1
0
        public void Initialize()
        {
            var consolesWithRoms = RomManager.Instance.GetAllRoms();
            List <CarouselItem> carouselItems = new List <CarouselItem>();

            foreach (var console in consolesWithRoms.Keys)
            {
                CarouselItem consoleItem = new CarouselItem();
                int          numRoms     = consolesWithRoms[console].Count;
                consoleItem.ItemImage      = console.ConsoleImage;
                consoleItem.Tag            = console;
                consoleItem.ItemStrings    = new string[2];
                consoleItem.ItemStrings[0] = console.FriendlyName;
                string numRomsStrings;
                if (numRoms > 1)
                {
                    numRomsStrings = String.Format("{0} Games", numRoms);
                }
                else
                {
                    numRomsStrings = String.Format("1 Game");
                }
                consoleItem.ItemStrings[1] = numRomsStrings;
                carouselItems.Add(consoleItem);
            }

            carousel = new Carousel(carouselItems, textRenderer);
        }
Beispiel #2
0
        public void Initialize()
        {
            var romMgr = RomManager.Instance;
            var roms   = romMgr.GetRoms(emulator);

            List <CarouselItem> carouselItems = new List <CarouselItem>();

            foreach (var rom in roms)
            {
                CarouselItem carouselItem = new CarouselItem();
                carouselItem.ItemImage      = rom.BoxArt;
                carouselItem.Tag            = rom;
                carouselItem.ItemStrings    = new string[2];
                carouselItem.ItemStrings[0] = rom.FriendlyName;
                carouselItem.ItemStrings[1] = String.Format("Time Played: {0}", rom.PrettyPrintPlayTime());
                carouselItems.Add(carouselItem);
            }

            carousel = new Carousel(carouselItems, textRenderer);
        }