public MainWindow( FlightInfoViewModel viewModel, SignalRLogic signalR, FlightLogic flightLogic, TestLogic testLogic, IFlightSimInterface flightSimInterface, FileWatcherLogic watcher, IStorageLogic storageLogic, ILogger <MainWindow> logger) { InitializeComponent(); this.viewModel = viewModel; this.signalR = signalR; this.flightLogic = flightLogic; this.testLogic = testLogic; this.flightSimInterface = flightSimInterface ?? throw new ArgumentNullException(nameof(flightSimInterface)); this.watcher = watcher ?? throw new ArgumentNullException(nameof(watcher)); this.storageLogic = storageLogic ?? throw new ArgumentNullException(nameof(storageLogic)); this.logger = logger; DataContext = viewModel; flightSimInterface.AircraftDataUpdated += FlightSimInterface_AircraftDataUpdated; flightSimInterface.FlightPlanUpdated += FlightSimInterface_FlightPlanUpdated; flightSimInterface.FlightStatusUpdated += FlightStatusUpdater_FlightStatusUpdated; watcher.FileCreated += Watcher_FileCreated; TextArchiveFolder.Text = storageLogic.ArchiveFolder; }
public SignalRLogic(ILogger <SignalRLogic> logger, IOptions <AppSettings> settings, IFlightSimInterface flightSimInterface, FlightLogic flightLogic) { connection = new HubConnectionBuilder() .WithUrl(settings.Value.BaseUrl + "/Hubs/Status") .WithAutomaticReconnect() .Build(); this.logger = logger; flightSimInterface.Closed += FlightSimInterface_Closed; flightSimInterface.FlightStatusUpdated += FlightSimInterface_FlightStatusUpdated; flightLogic.FlightUpdated += FlightLogic_FlightUpdated; Task.Factory.StartNew(PeriodicSendAsync); }
public FlightLogic(ILogger <FlightLogic> logger, FlightsAPIClient flightsAPIClient, IFlightSimInterface flightSimInterface, IImageUploader imageUploader) { this.logger = logger; this.flightsAPIClient = flightsAPIClient; this.imageUploader = imageUploader; flightSimInterface.EnvironmentDataUpdated += FlightSimInterface_EnvironmentDataUpdated; flightSimInterface.AirportListUpdated += FlightSimInterface_AirportListUpdated; flightSimInterface.AircraftDataUpdated += FlightSimInterface_AircraftDataUpdated; flightSimInterface.FlightPlanUpdated += FlightSimInterface_FlightPlanUpdated; flightSimInterface.FlightStatusUpdated += FlightSimInterface_FlightStatusUpdated; flightSimInterface.Crashed += FlightSimInterface_CrashedAsync; flightSimInterface.CrashReset += FlightSimInterface_CrashReset; flightSimInterface.Closed += FlightSimInterface_Closed; }