コード例 #1
0
        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;
        }
コード例 #2
0
        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;
        }
コード例 #3
0
        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;
        }
コード例 #4
0
        public RInteractiveWindowVisualComponent(IInteractiveWindow interactiveWindow, IVisualComponentContainer<IInteractiveWindowVisualComponent> container) {
            InteractiveWindow = interactiveWindow;
            Container = container;

            var textView = interactiveWindow.TextView;
            Controller = ServiceManagerBase.GetService<ICommandTarget>(textView);
            Control = textView.VisualElement;
            interactiveWindow.Properties.AddProperty(typeof(IInteractiveWindowVisualComponent), this);
        }
コード例 #5
0
 public RPlotManagerVisualComponent(IRPlotManager plotManager, IVisualComponentContainer <IRPlotManagerVisualComponent> container, IRSettings settings, ICoreShell coreShell)
 {
     Container  = container;
     Controller = null;
     ViewModel  = new RPlotManagerViewModel(plotManager);
     Control    = new RPlotManagerControl {
         DataContext = ViewModel,
     };
 }
コード例 #6
0
 public ConnectionManagerVisualComponent(IConnectionManager connectionManager, IVisualComponentContainer<IConnectionManagerVisualComponent> container, ICoreShell coreShell) {
     _viewModel = new ConnectionManagerViewModel(connectionManager, coreShell);
     Container = container;
     Controller = null;
     var control = new ConnectionManagerControl(coreShell) {
         DataContext = _viewModel
     };
     Control = control;
 }
コード例 #7
0
        public RHistoryWindowVisualComponent(ITextBuffer historyTextBuffer, IRHistoryProvider historyProvider, ITextEditorFactoryService textEditorFactory, IVisualComponentContainer <IRHistoryWindowVisualComponent> container)
        {
            _container = container;
            _history   = historyProvider.GetAssociatedRHistory(historyTextBuffer);

            TextView = CreateTextView(historyTextBuffer, textEditorFactory);
            TextView.Selection.SelectionChanged += TextViewSelectionChanged;

            Control = textEditorFactory.CreateTextViewHost(TextView, false).HostControl;
        }
コード例 #8
0
        public RHistoryWindowVisualComponent(ITextBuffer historyTextBuffer, IRHistoryProvider historyProvider, ITextEditorFactoryService textEditorFactory, IVisualComponentContainer<IRHistoryWindowVisualComponent> container) {
            _container = container;
            _history = historyProvider.GetAssociatedRHistory(historyTextBuffer);

            TextView = CreateTextView(historyTextBuffer, textEditorFactory);
            Control = textEditorFactory.CreateTextViewHost(TextView, false).HostControl;
            Controller = ServiceManagerBase.GetService<ICommandTarget>(TextView);

            TextView.Selection.SelectionChanged += TextViewSelectionChanged;
        }
コード例 #9
0
        public ConnectionManagerVisualComponent(IConnectionManager connectionManager, IVisualComponentContainer <IConnectionManagerVisualComponent> container, IRSettings settings, ICoreShell coreShell)
        {
            _viewModel = new ConnectionManagerViewModel(connectionManager, settings, coreShell);
            Container  = container;
            var control = new ConnectionManagerControl(coreShell)
            {
                DataContext = _viewModel
            };

            Control = control;
        }
コード例 #10
0
        public ConnectionManagerVisualComponent(IConnectionManager connectionManager, IVisualComponentContainer <IConnectionManagerVisualComponent> container, ICoreShell coreShell)
        {
            _viewModel = new ConnectionManagerViewModel(connectionManager, coreShell);
            Container  = container;
            Controller = null;
            var control = new ConnectionManagerControl {
                DataContext = _viewModel
            };

            Control = control;
        }
コード例 #11
0
        public RInteractiveWindowVisualComponent(IInteractiveWindow interactiveWindow, IVisualComponentContainer <IInteractiveWindowVisualComponent> container)
        {
            InteractiveWindow = interactiveWindow;
            Container         = container;

            var textView = interactiveWindow.TextView;

            Controller = ServiceManagerBase.GetService <ICommandTarget>(textView);
            Control    = textView.VisualElement;
            interactiveWindow.Properties.AddProperty(typeof(IInteractiveWindowVisualComponent), this);
        }
コード例 #12
0
        public ConnectionManagerVisual(IConnectionManager connectionManager, IVisualComponentContainer <IConnectionManagerVisual> container, IServiceContainer services)
        {
            _viewModel = new ConnectionManagerViewModel(connectionManager, services);
            Container  = container;
            var control = new ConnectionManagerControl(services)
            {
                DataContext = _viewModel
            };

            Control = control;
        }
コード例 #13
0
 public RPackageManagerVisualComponent(IRPackageManager packageManager, IVisualComponentContainer<IRPackageManagerVisualComponent> container, ISearchControlProvider searchControlProvider, IRSettings settings, ICoreShell coreShell) {
     _viewModel = new RPackageManagerViewModel(packageManager, settings, coreShell);
     Container = container;
     Controller = null;
     var control = new PackageManagerControl {
         DataContext = _viewModel,
     };
     Control = control;
     var searchControlSettings = new SearchControlSettings {
         SearchCategory = SearchCategory,
         MinWidth = (uint)control.SearchControlHost.MinWidth,
         MaxWidth = uint.MaxValue
     };
     _searchControl = searchControlProvider.Create(control.SearchControlHost, _viewModel, searchControlSettings);
 }
コード例 #14
0
        public RInteractiveWindowVisualComponent(IInteractiveWindow interactiveWindow, IVisualComponentContainer<IInteractiveWindowVisualComponent> container, IRSessionProvider sessionProvider, ICoreShell shell) {
            InteractiveWindow = interactiveWindow;
            Container = container;

            _sessionProvider = sessionProvider;
            _shell = shell;
            sessionProvider.BrokerStateChanged += OnBrokerChanged;

            var textView = interactiveWindow.TextView;
            Controller = ServiceManagerBase.GetService<ICommandTarget>(textView);
            Control = textView.VisualElement;
            interactiveWindow.Properties.AddProperty(typeof(IInteractiveWindowVisualComponent), this);

            UpdateWindowTitle(_sessionProvider.IsConnected);
        }
コード例 #15
0
        public RInteractiveWindowVisualComponent(IInteractiveWindow interactiveWindow, IVisualComponentContainer <IInteractiveWindowVisualComponent> container, IRSessionProvider sessionProvider, ICoreShell shell)
        {
            InteractiveWindow = interactiveWindow;
            Container         = container;

            _sessionProvider = sessionProvider;
            _shell           = shell;
            sessionProvider.BrokerStateChanged += OnBrokerChanged;

            var textView = interactiveWindow.TextView;

            Control = textView.VisualElement;
            interactiveWindow.Properties.AddProperty(typeof(IInteractiveWindowVisualComponent), this);

            UpdateWindowTitle(_sessionProvider.IsConnected);
        }
コード例 #16
0
        public RPackageManagerVisualComponent(IRPackageManager packageManager, IVisualComponentContainer <IRPackageManagerVisualComponent> container, ISearchControlProvider searchControlProvider, IRSettings settings, ICoreShell coreShell)
        {
            _viewModel = new RPackageManagerViewModel(packageManager, settings, coreShell);
            Container  = container;
            var control = new PackageManagerControl {
                DataContext = _viewModel,
            };

            Control = control;
            var searchControlSettings = new SearchControlSettings {
                SearchCategory = SearchCategory,
                MinWidth       = (uint)control.SearchControlHost.MinWidth,
                MaxWidth       = uint.MaxValue
            };

            _searchControl = searchControlProvider.Create(control.SearchControlHost, _viewModel, searchControlSettings);
        }
コード例 #17
0
        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;
        }
コード例 #18
0
        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;
        }
コード例 #19
0
        public RPackageManagerVisualComponent(IRPackageManager packageManager, IVisualComponentContainer <IRPackageManagerVisualComponent> container, ISearchControlProvider searchControlProvider, IServiceContainer services)
        {
            Container = container;
            var control = new PackageManagerControl(services);

            Control = control;

            var infoBarProvider = services.GetService <IInfoBarProvider>();
            var infoBar         = infoBarProvider.Create(control.InfoBarControlHost);

            _viewModel = new RPackageManagerViewModel(packageManager, infoBar, services);

            var searchControlSettings = new SearchControlSettings {
                SearchCategory = SearchCategory,
                MinWidth       = (uint)control.SearchControlHost.MinWidth,
                MaxWidth       = uint.MaxValue
            };

            _searchControl = searchControlProvider.Create(control.SearchControlHost, _viewModel, searchControlSettings);

            control.DataContext = _viewModel;
        }
コード例 #20
0
        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;
        }