public RPlotHistoryViewModel(IRPlotManager plotManager, ICoreShell shell) { if (plotManager == null) { throw new ArgumentNullException(nameof(plotManager)); } if (shell == null) { throw new ArgumentNullException(nameof(shell)); } _plotManager = plotManager; _shell = shell; _disposableBag = DisposableBag.Create<RPlotHistoryViewModel>() .Add(() => _plotManager.DeviceAdded -= DeviceAdded) .Add(() => _plotManager.DeviceRemoved -= DeviceRemoved); _plotManager.DeviceAdded += DeviceAdded; _plotManager.DeviceRemoved += DeviceRemoved; foreach (var group in _plotManager.GetAllPlots().GroupBy(p => p.ParentDevice)) { SubscribeDeviceEvents(group.Key); foreach (var plot in group) { Entries.Add(new RPlotHistoryEntryViewModel(_plotManager, _shell, plot, plot.Image)); } } }
public RPlotHistoryViewModel(RPlotHistoryControl control, IRPlotManager plotManager, IMainThread mainThread) { Check.ArgumentNull(nameof(control), control); Check.ArgumentNull(nameof(plotManager), plotManager); Check.ArgumentNull(nameof(mainThread), mainThread); _control = control; _plotManager = plotManager; _mainThread = mainThread; _disposableBag = DisposableBag.Create <RPlotHistoryViewModel>() .Add(() => _plotManager.DeviceAdded -= DeviceAdded) .Add(() => _plotManager.DeviceRemoved -= DeviceRemoved); _plotManager.DeviceAdded += DeviceAdded; _plotManager.DeviceRemoved += DeviceRemoved; foreach (var group in _plotManager.GetAllPlots().GroupBy(p => p.ParentDevice)) { SubscribeDeviceEvents(group.Key); foreach (var plot in group) { Entries.Add(new RPlotHistoryEntryViewModel(_plotManager, _mainThread, plot, plot.Image)); } } }
public RPlotHistoryViewModel(IRPlotManager plotManager, ICoreShell shell) { if (plotManager == null) { throw new ArgumentNullException(nameof(plotManager)); } if (shell == null) { throw new ArgumentNullException(nameof(shell)); } _plotManager = plotManager; _shell = shell; _disposableBag = DisposableBag.Create <RPlotHistoryViewModel>() .Add(() => _plotManager.DeviceAdded -= DeviceAdded) .Add(() => _plotManager.DeviceRemoved -= DeviceRemoved); _plotManager.DeviceAdded += DeviceAdded; _plotManager.DeviceRemoved += DeviceRemoved; foreach (var group in _plotManager.GetAllPlots().GroupBy(p => p.ParentDevice)) { SubscribeDeviceEvents(group.Key); foreach (var plot in group) { Entries.Add(new RPlotHistoryEntryViewModel(_plotManager, _shell, plot, plot.Image)); } } }