private async void Stop()
        {
            CoreOperationsAllowed = false;
            await EmulationService.StopGameAsync();

            CoreOperationsAllowed = true;
        }
        public async Task StartGameFromFileAsync(IFileInfo file)
        {
            //Find compatible systems for file extension
            var compatibleSystems = await EmulationService.FilterSystemsForFileAsync(file);

            //If none, do nothing
            if (!compatibleSystems.Any())
            {
                return;
            }

            //If just one, start game with it
            if (compatibleSystems.Count() == 1)
            {
                await StartGameAsync(compatibleSystems.First(), file);

                return;
            }

            //If multiple ones, filter system selection accordingly and have user select a system
            await EmulationService.StopGameAsync();

            GameSystems      = compatibleSystems.ToArray();
            SelectedGameFile = file;
        }
Example #3
0
        public async Task StartGameFromFileAsync(IFileInfo file)
        {
            //Find compatible systems for file extension
            var extension         = Path.GetExtension(file.Name);
            var compatibleSystems = EmulationService.Systems.Where(d => d.SupportedExtensions.Contains(extension));

            //If none, do nothing
            if (!compatibleSystems.Any())
            {
                return;
            }

            //If just one, start game with it
            if (compatibleSystems.Count() == 1)
            {
                await StartGameAsync(compatibleSystems.First(), file);

                return;
            }

            //If multiple ones, filter system selection accordingly and have user select a system
            await EmulationService.StopGameAsync();

            GameSystems      = compatibleSystems.ToArray();
            SelectedGameFile = file;
        }