public ViewController( ISessionFactory sessionFactory, IProjectFactory projectFactory, IIbtFileParser telemetryFileParser, IOptionsMonitor <iRacingTelemetryOptions> optionsAccessor, ILog log, IServiceProvider serviceProvider, IDisplayInfoService displayInfoService) { _serviceProvider = serviceProvider; _sessionFactory = (sessionFactory == null) ? throw new ArgumentNullException(nameof(sessionFactory)) : sessionFactory; _projectFactory = (projectFactory == null) ? throw new ArgumentNullException(nameof(projectFactory)) : projectFactory; _displayInfoService = (displayInfoService == null) ? throw new ArgumentNullException(nameof(displayInfoService)) : displayInfoService; _telemetryFileParser = (telemetryFileParser == null) ? throw new ArgumentNullException(nameof(telemetryFileParser)) : telemetryFileParser; _options = (optionsAccessor == null) ? throw new ArgumentNullException(nameof(optionsAccessor)) : optionsAccessor.CurrentValue; Log = (log == null) ? throw new ArgumentNullException(nameof(log)) : log; MdiChildren = new ObservableCollection <IMdiChildForm>(); MdiChildren.CollectionChanged += MdiChildren_CollectionChanged; PropertyChanged += TelemetryViewController_PropertyChanged; ProjectClosing += TelemetryViewController_ProjectClosing; Task.Run(async() => { await LoadFieldDefinitionsAsync(); FieldDefinitions.CollectionChanged += FieldDefinitions_CollectionChanged; await LoadFieldDisplayInfos(); FieldDisplayInfos.CollectionChanged += FieldDisplayInfos_CollectionChanged; }); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var services = new ServiceCollection(); log.Info("Hello logging world!"); services.AddSingleton <ILog>(log); services.AddCommon(); services.AddTelemetryViewer(); _serviceProvider = services.BuildServiceProvider(); IOptionsMonitor <iRacingTelemetryOptions> optionsAccessor = _serviceProvider.GetRequiredService <IOptionsMonitor <iRacingTelemetryOptions> >(); iRacingTelemetryOptions options = (optionsAccessor == null) ? throw new ArgumentNullException(nameof(optionsAccessor)) : optionsAccessor.CurrentValue; //ILoggerFactory loggerFactory = _serviceProvider.GetRequiredService<ILoggerFactory>(); //loggerFactory.AddConsole(); //var logger = loggerFactory.CreateLogger<MainView>(); var controller = _serviceProvider.GetRequiredService <IViewController>(); Application.Run(new MainView( controller, _serviceProvider, log, options)); }
protected JsonFileRepository( IOptionsMonitor <iRacingTelemetryOptions> optionsAccessor, ILog log) { _options = (optionsAccessor == null) ? throw new ArgumentNullException(nameof(optionsAccessor)) : optionsAccessor.CurrentValue; _logger = (log == null) ? throw new ArgumentNullException(nameof(log)) : log; }
protected JsonFileRepository( IOptionsMonitor <iRacingTelemetryOptions> optionsAccessor, ILoggerFactory loggerFactory) { _options = (optionsAccessor == null) ? throw new ArgumentNullException(nameof(optionsAccessor)) : optionsAccessor.CurrentValue; var localLoggerFactory = (loggerFactory == null) ? throw new ArgumentNullException(nameof(loggerFactory)) : loggerFactory; localLoggerFactory.AddConsole((category, logLevel) => logLevel >= LogLevel.Trace); _logger = localLoggerFactory.CreateLogger <JsonFileRepository>(); }
public HistogramDisplay( IServiceProvider serviceProvider, log4net.ILog log, iRacingTelemetryOptions options) : base( serviceProvider, log, options, DisplayTypes.Histogram) { InitializeComponent(); }
public WaveformDisplay( IServiceProvider serviceProvider, log4net.ILog log, iRacingTelemetryOptions options, IFormDisplayInfo displayInfo) : this( serviceProvider, log, options) { this.FormDisplayInfo = displayInfo; }
public TrackMapDisplay( IServiceProvider serviceProvider, log4net.ILog log, iRacingTelemetryOptions options) : base( serviceProvider, log, options, DisplayTypes.TrackMap) { InitializeComponent(); }
public MdiChildForm( IServiceProvider serviceProvider, log4net.ILog log, iRacingTelemetryOptions options, DisplayTypes displayType) : base(serviceProvider, log, options, displayType) { InitializeComponent(); }
public SessionDetailsDisplay( IServiceProvider serviceProvider, log4net.ILog log, iRacingTelemetryOptions options) : base( serviceProvider, log, options, DisplayTypes.SessionDetails) { InitializeComponent(); }
public GoogleTrackMapService( IImageHelper imageHelper, IOptionsMonitor <iRacingTelemetryOptions> optionsAccessor, ILoggerFactory loggerFactory) { _imageHelper = (imageHelper == null) ? throw new ArgumentNullException(nameof(imageHelper)) : imageHelper; _options = (optionsAccessor == null) ? throw new ArgumentNullException(nameof(optionsAccessor)) : optionsAccessor.CurrentValue; var localLoggerFactory = (loggerFactory == null) ? throw new ArgumentNullException(nameof(loggerFactory)) : loggerFactory; localLoggerFactory.AddConsole((category, logLevel) => logLevel >= LogLevel.Trace); _logger = localLoggerFactory.CreateLogger <GoogleTrackMapService>(); }
public MainView( IViewController controller, IServiceProvider serviceProvider, ILog log, iRacingTelemetryOptions options) : base( controller, serviceProvider, log, options) { InitializeComponent(); }
public TelemetryForm( IServiceProvider serviceProvider, ILog log, iRacingTelemetryOptions options, DisplayTypes displayType) : this() { FormDisplayInfo.DisplayType = displayType; FormDisplayInfo.Name = displayType.ToString(); _serviceProvider = (serviceProvider == null) ? throw new ArgumentNullException(nameof(serviceProvider)) : serviceProvider; Log = (log == null) ? throw new ArgumentNullException(nameof(log)) : log; Options = (options == null) ? throw new ArgumentNullException(nameof(options)) : options; }
public MdiParentForm( IViewController controller, IServiceProvider serviceProvider, ILog log, iRacingTelemetryOptions options) : base( serviceProvider, log, options, DisplayTypes.MdiParent) { InitializeComponent(); Controller = controller; Controller.SetParent(this.WindowHandle); }
private async void TrackMapBuilderView_Load(object sender, EventArgs e) { try { _trackMapRepo = ServiceProvider.GetRequiredService <ITrackMapRepository>(); _imageHelper = ServiceProvider.GetRequiredService <IImageHelper>(); _mapService = ServiceProvider.GetRequiredService <ITrackMapService>(); _telemetryFileParser = ServiceProvider.GetRequiredService <IIbtFileParser>(); IOptionsMonitor <iRacingTelemetryOptions> optionsAccessor = ServiceProvider.GetRequiredService <IOptionsMonitor <iRacingTelemetryOptions> >(); _options = (optionsAccessor == null) ? throw new ArgumentNullException(nameof(optionsAccessor)) : optionsAccessor.CurrentValue; await GetTrackMapList(); _loading = false; } catch (Exception ex) { ExceptionHandler(ex); } }