Пример #1
0
        bool handleStartupItem(int index)
        {
            if (startupGame != null)
            {
                setItemsToFacade(new[] { startupGame }, null, 0, 0);
                gameSelected(facade.SelectedListItem as ExtendedGUIListItem, true);
                if (launchStartupItem)
                {
                    launchStartupItem = false; //otherwise continuous loop of rom launch
                    LaunchHandler.Instance.StartLaunch(startupGame);
                }
                return(true);
            }

            if (startupEmu != null)
            {
                setItemsToFacade(DB.Instance.GetGames(startupEmu), null, 0, index);
                setLayout(startupEmu.View);
                return(true);
            }

            if (startupGroup != null)
            {
                startupGroup.Refresh();
                SortProperty = startupGroup.SortProperty;
                if (sortAsc == startupGroup.SortDescending)
                {
                    sortAsc = !startupGroup.SortDescending;
                    if (OnSortAscendingChanged != null)
                    {
                        OnSortAscendingChanged(sortAsc);
                    }
                }
                setItemsToFacade(startupGroup.GroupItems, null, 0, index);
                if (startupGroup.Layout < 0)
                {
                    startupGroup.Layout = currentLayout;
                }
                else
                {
                    setLayout(startupGroup.Layout);
                }
                return(true);
            }

            return(false);
        }
Пример #2
0
        bool groupSelected(ExtendedGUIListItem selectedListItem, int index, int parentIndex, bool allowSortChange)
        {
            RomGroup romGroup = selectedListItem.RomGroup;

            if (romGroup == null)
            {
                return(false);
            }

            romGroup.Refresh();
            if (romGroup.GroupItems.Count < 1)
            {
                return(false);
            }

            if (allowSortChange)
            {
                SortProperty = romGroup.SortProperty;
                if (sortAsc == romGroup.SortDescending)
                {
                    sortAsc = !romGroup.SortDescending;
                    if (OnSortAscendingChanged != null)
                    {
                        OnSortAscendingChanged(sortAsc);
                    }
                }
            }

            setItemsToFacade(romGroup.GroupItems, selectedListItem, parentIndex, index);

            lastItem      = selectedListItem;
            lastitemIndex = parentIndex;
            if (romGroup.Layout < 0)
            {
                romGroup.Layout = currentLayout;
            }
            else
            {
                setLayout(romGroup.Layout);
            }
            return(true);
        }
        public void GroupSelected(RomGroup group)
        {
            group.Refresh();
            List<ListItem> items = new List<ListItem>();
            foreach (DBItem item in group.GroupItems)
            {
                Game game = item as Game;
                if (game != null)
                {
                    items.Add(new GameViewModel(game, this));
                    continue;
                }

                RomGroup subGroup = item as RomGroup;
                if (subGroup != null)
                {
                    items.Add(new GroupViewModel(subGroup, this));
                    continue;
                }

                Emulator emulator = item as Emulator;
                if (emulator != null)
                    items.Add(new EmulatorViewModel(emulator, this));
            }

            NavigationData navigationData = new NavigationData() { DisplayName = group.Title, ItemsList = items };
            PushTransientState("emuSubGroup", navigationData.DisplayName, navigationData);
        }