コード例 #1
0
        private void LoadMonitoringDisplay(GameMonitorFormViewModel gameMonitorFormViewModel, GameMonitorDisplayFactory gameMonitorDisplayFactory)
        {
            if (chooseGameDialog.ShowDialog() != DialogResult.OK)
            {
                logger.Debug("Browse File Dialog did not return Okay.");
                return;
            }

            if (gameMonitorFormViewModel.ShouldMonitor(chooseGameDialog.FileName))
            {
                logger.Debug("Adding a new Game Monitoring Display.");
                var display = gameMonitorDisplayFactory.CreateNewDisplay(chooseGameDialog.FileName);
                mainPanel.Controls.Add(display);
            }
            else
            {
                logger.Debug("Duplicate file name chosen.");
                MessageBox.Show(@"Program is already being Monitored.");
            }
        }
コード例 #2
0
 public GameMonitorFormViewModel CreateNewFormViewModel()
 {
     var gameMonitorFormViewModel = new GameMonitorFormViewModel(loggerFactory);
     return gameMonitorFormViewModel;
 }