コード例 #1
0
 private static void CreateMonitor()
 {
     _ = _app.Dispatcher.BeginInvoke(new Action(() =>
     {
         _monitor = new MonitorWindow(CURRENT);
         _monitor.SetVM(_VM);
         _monitor.Closed += _monitor_Closed;
         _monitor.Show();
     }));
 }
コード例 #2
0
        private static void InitVM()
        {
            CancelThreads();

            var vm = _VM = _serviceProvider.GetService <RC2014.EMU.RC2014>();

            _monitor?.SetVM(vm);

            var console = vm.Ports.First(p => p is IConsoleFeed) as IConsoleFeed;

            console.Initalise();

            _cancellationTokenSource = new CancellationTokenSource();
            _cancellationToken       = _cancellationTokenSource.Token;

            _tasks.Prepend(Task.Factory.StartNew(() => console.KeyboardHandler(_cancellationToken, HandleKey), _cancellationToken));
        }