예제 #1
0
        public AvionicsBridgeViewModel()
        {
            ErrorMessages = new ObservableCollection <string>();

            ToggleConnectCommand   = new BaseCommand((p) => { ToggleConnect(); });
            ToggleBroadcastCommand = new BaseCommand((p) => { ToggleBroadcast(); });

            _timer.Interval = new TimeSpan(0, 0, 0, 1, 0);
            _timer.Tick    += new EventHandler(OnTick);

            ConnectionSettingsViewModel = new ConnectionSettingsViewModel();
            SimVarsViewModel            = new SimVarsViewModel();
        }
예제 #2
0
        public void Disconnect()
        {
            Console.WriteLine("Disconnect");

            _timer.Stop();
            OddTick = false;

            if (_simConnect != null)
            {
                /// Dispose serves the same purpose as SimConnect_Close()
                _simConnect.Dispose();
                _simConnect = null;
            }

            ConnectButtonLabel = "Connect";
            Connected          = false;

            // Set all requests as pending
            SimVarsViewModel.ResetAllRequests();
        }