示例#1
0
        public void CanValidateApps(string appPath, string appCmd, bool expectedResult)
        {
            var app = new AdditionalApplicationMock {
                ApplicationPath = appPath, CommandLine = appCmd
            };

            var isValid = GameVideo.IsAppCorrectlySetup(app);

            Assert.Equal(expectedResult, isValid);
        }
示例#2
0
        public void OnEventRaised(string eventType)
        {
            // On startup, we want to check if Launchbox's VLC distribution has the latest YouTube addon.
            if (eventType == SystemEventTypes.LaunchBoxStartupCompleted ||
                eventType == SystemEventTypes.BigBoxStartupCompleted)
            {
                VlcUtilities.VerifyYoutubeAddon();
            }
            else if (eventType == SystemEventTypes.SelectionChanged)
            {
                // When a game is selected, I want to check that the additional apps
                // for launching our videos are set up correctly.
                // This ensures that video link apps are always up to date with
                // the latest VLC path and command-line arguments.
                var selectedGames = PluginHelper.StateManager.GetAllSelectedGames();
                if (selectedGames.Length == 1)
                {
                    var game          = selectedGames[0];
                    var videoLinkApps = game.GetAllAdditionalApplications()
                                        .Where(x => x.Name.StartsWith(GameVideo.TitlePrefix))
                                        .ToList();

                    if (videoLinkApps.Count != 0)
                    {
                        foreach (var app in videoLinkApps)
                        {
                            if (!GameVideo.IsAppCorrectlySetup(app))
                            {
                                var gameVideo = new GameVideo(app);
                                gameVideo.UpdateExistingApp(app);
                            }
                        }
                    }
                }
            }
        }