示例#1
0
        private PlayerNotifier GetPlayerNotifier(Views.MainWindow mainWindow)
        {
            PlayerNotifier playerNotifier = null;
            //create the notifyicon (it's a resource declared in NotifyIconResources.xaml
            var notifyIcon = (TaskbarIcon)FindResource("NotifyIcon");

            if (notifyIcon == null)
            {
                return(null);
            }
            notifyIcon.Icon = Icons.Resources.Logo;
            var toast = new Toast(notifyIcon);
            var taskbarIconAdapter = new ToastDisplayer(toast);

            playerNotifier         = new PlayerNotifier(taskbarIconAdapter);
            notifyIcon.DataContext = mainWindow.ViewModel;
            return(playerNotifier);
        }
示例#2
0
        private void Bootstrap()
        {
            _kataraiApp = new KataraiApp();

            var mainWindow = Current.MainWindow as Views.MainWindow;

            if (mainWindow == null)
            {
                return;
            }

            var playerNotifier = GetPlayerNotifier(mainWindow);

            if (playerNotifier == null)
            {
                return;
            }

            _playerNotifier = playerNotifier;

            mainWindow.ViewModel.KataraiApp     = _kataraiApp;
            mainWindow.ViewModel.PlayerNotifier = _playerNotifier;

            _playerNotifier.DisplayMessage("Welcome to Katarai",
                                           "Katarai is a tool to help you do code katas. In this version the supported katas are Roy Osherove’s String Calculator kata." +
                                           "To the katas, select Practice from the System Tray menu – Katarai will open Visual Studio with a prepared solution to get you started and will track your progress as you code." +
                                           Environment.NewLine + Environment.NewLine +
                                           "Why is TDD important? It allows us to break the negative feedback loop and maintain a constant cost of change." +
                                           "Only by actively driving down the defects in our code are we able to deliver new functionality, and modify existing functionality with a reasonably constant cost of change." +
                                           Environment.NewLine + Environment.NewLine +
                                           "To configure Katarai’s options click Show Window in the System Tray menu." + Environment.NewLine +
                                           Environment.NewLine +
                                           "To view your previous kata attempt statistics, use the Statistics menu in the System Tray menu."
                                           );

            StartSplunkLogging();

            StartReminderTimer();
            StartMonitorTimer();
            StartGameMonitor();

            StartFileMonitor();
        }