public IVisualComponentContainer <IRPlotDeviceVisualComponent> GetOrCreate(IRPlotManager plotManager, IRSession session, int instanceId = 0) { return(GetOrCreate(instanceId, container => new RPlotDeviceVisualComponent(plotManager, null, instanceId, container, _coreShell) { TestDeviceProperties = DeviceProperties })); }
public RPlotDeviceVisualComponent(IRPlotManager plotManager , int instanceId , IVisualComponentContainer <IRPlotDeviceVisualComponent> container , IServiceContainer services) { Check.ArgumentNull(nameof(plotManager), plotManager); Check.ArgumentNull(nameof(plotManager), plotManager); _mainThread = services.MainThread(); _viewModel = new RPlotDeviceViewModel(plotManager, _mainThread, instanceId); var control = new RPlotDeviceControl { DataContext = _viewModel, }; _disposableBag = DisposableBag.Create <RPlotDeviceVisualComponent>() .Add(() => control.ContextMenuRequested -= Control_ContextMenuRequested) .Add(() => _viewModel.DeviceNameChanged -= ViewModel_DeviceNameChanged) .Add(() => _viewModel.LocatorModeChanged -= ViewModel_LocatorModeChanged) .Add(() => _viewModel.PlotChanged -= ViewModel_PlotChanged) .Add(() => plotManager.ActiveDeviceChanged -= PlotManager_ActiveDeviceChanged); control.ContextMenuRequested += Control_ContextMenuRequested; _viewModel.DeviceNameChanged += ViewModel_DeviceNameChanged; _viewModel.LocatorModeChanged += ViewModel_LocatorModeChanged; _viewModel.PlotChanged += ViewModel_PlotChanged; plotManager.ActiveDeviceChanged += PlotManager_ActiveDeviceChanged; Control = control; Container = container; }
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(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 RPlotHistoryVisualComponent(IRPlotManager plotManager, ICommandTarget controller, IVisualComponentContainer <IRPlotHistoryVisualComponent> container, ICoreShell coreShell) { if (plotManager == null) { throw new ArgumentNullException(nameof(plotManager)); } if (container == null) { throw new ArgumentNullException(nameof(container)); } if (coreShell == null) { throw new ArgumentNullException(nameof(coreShell)); } _plotManager = plotManager; _viewModel = new RPlotHistoryViewModel(plotManager, coreShell); _shell = coreShell; var control = new RPlotHistoryControl { DataContext = _viewModel }; _disposableBag = DisposableBag.Create <RPlotDeviceVisualComponent>() .Add(() => control.ContextMenuRequested -= Control_ContextMenuRequested); control.ContextMenuRequested += Control_ContextMenuRequested; Control = control; Controller = controller; Container = container; }
public RPlotHistoryVisualComponent(IRPlotManager plotManager, ICommandTarget controller, IVisualComponentContainer<IRPlotHistoryVisualComponent> container, ICoreShell coreShell) { if (plotManager == null) { throw new ArgumentNullException(nameof(plotManager)); } if (container == null) { throw new ArgumentNullException(nameof(container)); } if (coreShell == null) { throw new ArgumentNullException(nameof(coreShell)); } _plotManager = plotManager; _viewModel = new RPlotHistoryViewModel(plotManager, coreShell); _shell = coreShell; var control = new RPlotHistoryControl { DataContext = _viewModel }; _disposableBag = DisposableBag.Create<RPlotDeviceVisualComponent>() .Add(() => control.ContextMenuRequested -= Control_ContextMenuRequested); control.ContextMenuRequested += Control_ContextMenuRequested; Control = control; Controller = controller; Container = container; }
public RPlotManagerVisualComponent(IRPlotManager plotManager, IVisualComponentContainer <IRPlotManagerVisualComponent> container, IRSettings settings, ICoreShell coreShell) { Container = container; Controller = null; ViewModel = new RPlotManagerViewModel(plotManager); Control = new RPlotManagerControl { DataContext = ViewModel, }; }
public PlotHistoryWindowPane(IRPlotManager plotManager, IServiceContainer services) : base(services) { _plotManager = plotManager; // this value matches with icmdShowPlotWindow's Icon in VSCT file BitmapImageMoniker = KnownMonikers.ChartFilter; Caption = Resources.PlotHistoryWindowCaption; ToolBar = new System.ComponentModel.Design.CommandID(RGuidList.RCmdSetGuid, RPackageCommandId.plotHistoryWindowToolBarId); }
public RPlotDeviceViewModel(IRPlotManager plotManager, IMainThread mainThread, int instanceId) { Check.ArgumentNull(nameof(plotManager), plotManager); Check.ArgumentNull(nameof(mainThread), mainThread); _plotManager = plotManager; _mainThread = mainThread; InstanceId = instanceId; _showWatermark = true; }
public IVisualComponentContainer <IRPlotManagerVisualComponent> GetOrCreate(IRPlotManager plotManager, IRSession session, int instanceId = 0) { var workflow = _workflowProvider.GetOrCreate(); if (workflow.ActiveWindow == null) { VsAppShell.Current.DispatchOnUIThread(() => workflow.GetOrCreateVisualComponent(_componentContainerFactory).DoNotWait()); } return(GetOrCreate(instanceId, i => new PlotManagerWindowPane(plotManager, session, RToolsSettings.Current, VsAppShell.Current))); }
public PlotManagerWindowPane(IRPlotManager plotManager, IRSettings settings, ICoreShell coreShell) { _plotManager = plotManager; _settings = settings; _coreShell = coreShell; // this value matches with icmdShowPlotWindow's Icon in VSCT file BitmapImageMoniker = KnownMonikers.LineChart; Caption = Resources.PlotWindowCaption; ToolBar = new CommandID(RGuidList.RCmdSetGuid, RPackageCommandId.plotWindowToolBarId); }
public RPlotHistoryEntryViewModel(IRPlotManager plotManager, IMainThread mainThread, IRPlot plot, object plotImage) { Check.ArgumentNull(nameof(plotManager), plotManager); Check.ArgumentNull(nameof(mainThread), mainThread); Check.ArgumentNull(nameof(plot), plot); Check.ArgumentNull(nameof(plotImage), plotImage); _plotManager = plotManager; _mainThread = mainThread; _plot = plot; _plotImage = plotImage; RefreshDeviceName(); }
public RPlotDeviceViewModel(IRPlotManager plotManager, ICoreShell shell, int instanceId) { if (plotManager == null) { throw new ArgumentNullException(nameof(plotManager)); } if (shell == null) { throw new ArgumentNullException(nameof(shell)); } _plotManager = plotManager; _shell = shell; InstanceId = instanceId; _showWatermark = true; }
public RPlotHistoryVisualComponent(IRPlotManager plotManager, IVisualComponentContainer <IRPlotHistoryVisualComponent> container, IServiceContainer services) { Check.ArgumentNull(nameof(plotManager), plotManager); Check.ArgumentNull(nameof(container), container); Check.ArgumentNull(nameof(services), services); var control = new RPlotHistoryControl(); _viewModel = new RPlotHistoryViewModel(control, plotManager, services.MainThread()); control.DataContext = _viewModel; _disposableBag = DisposableBag.Create <RPlotDeviceVisualComponent>() .Add(() => control.ContextMenuRequested -= Control_ContextMenuRequested); control.ContextMenuRequested += Control_ContextMenuRequested; Control = control; Container = container; }
public RPlotDeviceVisualComponent(IRPlotManager plotManager, ICommandTarget controller, int instanceId, IVisualComponentContainer <IRPlotDeviceVisualComponent> container, ICoreShell coreShell) { if (plotManager == null) { throw new ArgumentNullException(nameof(plotManager)); } if (container == null) { throw new ArgumentNullException(nameof(container)); } if (coreShell == null) { throw new ArgumentNullException(nameof(coreShell)); } _plotManager = plotManager; _viewModel = new RPlotDeviceViewModel(plotManager, coreShell, instanceId); _shell = coreShell; var control = new RPlotDeviceControl { DataContext = _viewModel, }; _disposableBag = DisposableBag.Create <RPlotDeviceVisualComponent>() .Add(() => control.ContextMenuRequested -= Control_ContextMenuRequested) .Add(() => _viewModel.DeviceNameChanged -= ViewModel_DeviceNameChanged) .Add(() => _viewModel.LocatorModeChanged -= ViewModel_LocatorModeChanged) .Add(() => _viewModel.PlotChanged += ViewModel_PlotChanged) .Add(() => _plotManager.ActiveDeviceChanged += PlotManager_ActiveDeviceChanged); control.ContextMenuRequested += Control_ContextMenuRequested; _viewModel.DeviceNameChanged += ViewModel_DeviceNameChanged; _viewModel.LocatorModeChanged += ViewModel_LocatorModeChanged; _viewModel.PlotChanged += ViewModel_PlotChanged; _plotManager.ActiveDeviceChanged += PlotManager_ActiveDeviceChanged; Control = control; Controller = controller; Container = container; }
public RPlotHistoryEntryViewModel(IRPlotManager plotManager, ICoreShell shell, IRPlot plot, BitmapImage plotImage) { if (plotManager == null) { throw new ArgumentNullException(nameof(plotManager)); } if (shell == null) { throw new ArgumentNullException(nameof(shell)); } if (plot == null) { throw new ArgumentNullException(nameof(plot)); } _plotManager = plotManager; _shell = shell; _plot = plot; _plotImage = plotImage; RefreshDeviceName(); }
public RPlotDeviceVisualComponent(IRPlotManager plotManager, ICommandTarget controller, int instanceId, IVisualComponentContainer<IRPlotDeviceVisualComponent> container, ICoreShell coreShell) { if (plotManager == null) { throw new ArgumentNullException(nameof(plotManager)); } if (container == null) { throw new ArgumentNullException(nameof(container)); } if (coreShell == null) { throw new ArgumentNullException(nameof(coreShell)); } _plotManager = plotManager; _viewModel = new RPlotDeviceViewModel(plotManager, coreShell, instanceId); _shell = coreShell; var control = new RPlotDeviceControl { DataContext = _viewModel, }; _disposableBag = DisposableBag.Create<RPlotDeviceVisualComponent>() .Add(() => control.ContextMenuRequested -= Control_ContextMenuRequested) .Add(() => _viewModel.DeviceNameChanged -= ViewModel_DeviceNameChanged) .Add(() => _viewModel.LocatorModeChanged -= ViewModel_LocatorModeChanged) .Add(() => _viewModel.PlotChanged += ViewModel_PlotChanged) .Add(() => _plotManager.ActiveDeviceChanged += PlotManager_ActiveDeviceChanged); control.ContextMenuRequested += Control_ContextMenuRequested; _viewModel.DeviceNameChanged += ViewModel_DeviceNameChanged; _viewModel.LocatorModeChanged += ViewModel_LocatorModeChanged; _viewModel.PlotChanged += ViewModel_PlotChanged; _plotManager.ActiveDeviceChanged += PlotManager_ActiveDeviceChanged; Control = control; Controller = controller; Container = container; }
public IVisualComponentContainer <IRPlotManagerVisualComponent> GetOrCreate(IRPlotManager plotManager, IRSession session, int instanceId = 0) { return(GetOrCreate(instanceId, container => new RPlotManagerVisualComponent(plotManager, container, session, _settings, _coreShell))); }
public RPlotManagerViewModel(IRPlotManager plotManager) { _plotManager = plotManager; _showWatermark = true; }
public IVisualComponentContainer <IRPlotHistoryVisualComponent> GetOrCreate(IRPlotManager plotManager, int instanceId = 0) { return(GetOrCreate(instanceId, i => new PlotHistoryWindowPane(plotManager, i, RToolsSettings.Current, VsAppShell.Current))); }
public ShowPlotWindowCommand(IApplicationShell appShell, IRInteractiveWorkflow workflow) { _plotManager = workflow.Plots; _shell = appShell.GlobalServices.GetService <IVsUIShell4>(typeof(SVsUIShell)); }
public IVisualComponentContainer <IRPlotHistoryVisualComponent> GetOrCreate(IRPlotManager plotManager, int instanceId = 0) => GetOrCreate(instanceId, i => new PlotHistoryWindowPane(plotManager, _coreShell.Services));
public ShowPlotWindowCommand(IApplicationShell appShell, IRInteractiveWorkflow workflow) { _plotManager = workflow.Plots; _shell = appShell.GetGlobalService<IVsUIShell4>(typeof(SVsUIShell)); }
public IVisualComponentContainer <IRPlotDeviceVisualComponent> GetOrCreate(IRPlotManager plotManager, IRSession session, int instanceId = 0) { return(GetOrCreate(instanceId, i => new PlotDeviceWindowPane(plotManager, session, i, RToolsSettings.Current, VsAppShell.Current))); }
public static IRPlotHistoryVisualComponent GetOrCreateVisualComponent(this IRPlotManager pm, IRPlotHistoryVisualComponentContainerFactory factory, int id) => ((IRPlotManagerVisual)pm).GetOrCreateVisualComponent(factory, id);
public IVisualComponentContainer <IRPlotHistoryVisualComponent> GetOrCreate(IRPlotManager plotManager, int instanceId = 0) { return(GetOrCreate(instanceId, container => new RPlotHistoryVisualComponent(plotManager, container, _coreShell.Services))); }