예제 #1
0
        public MainWindow(ILogger <MainWindow> logger, IFlightConnector flightConnector, MainViewModel viewModel,
                          IOptionsMonitor <AppSettings> appSettings,
                          DiscordRichPresentLogic discordRichPresentLogic,
                          ATCServer atcServer, UserPreferencesLoader userPreferencesLoader, VersionLogic versionLogic,
                          UdpBroadcastLogic udpBroadcastLogic)
        {
            InitializeComponent();

            this.logger                  = logger;
            this.flightConnector         = flightConnector;
            this.atcServer               = atcServer;
            this.userPreferencesLoader   = userPreferencesLoader;
            this.versionLogic            = versionLogic;
            this.udpBroadcastLogic       = udpBroadcastLogic;
            this.viewModel               = viewModel;
            this.discordRichPresentLogic = discordRichPresentLogic;
            this.appSettings             = appSettings.CurrentValue;
            this.lineSimplifier          = new LineSimplifier();

            flightConnector.AircraftStatusUpdated   += FlightConnector_AircraftStatusUpdated;
            flightConnector.AircraftPositionChanged += FlightConnector_AircraftPositionChanged;
            flightConnector.AirportListReceived     += FlightConnector_AirportListReceived;
            flightConnector.Error += FlightConnector_Error;

            DataContext = viewModel;
        }
예제 #2
0
        private void ButtonStartVATSIM_Click(object sender, RoutedEventArgs e)
        {
            var loggerFactory = LoggerFactory.Create(config => config.AddDebug().SetMinimumLevel(LogLevel.Information));

            atcServer            = new ATCServer(loggerFactory.CreateLogger <ATCServer>());
            atcServer.Connected += AtcServer_Connected;
            atcServer.Start();
        }
예제 #3
0
 private void ButtonStopVATSIM_Click(object sender, RoutedEventArgs e)
 {
     atcServer?.Stop();
     atcServer = null;
 }