示例#1
0
 public InterpreterManager(IFileSystem fs, IRInstallationService installationService, IOptions <ROptions> options, ILogger <InterpreterManager> logger)
 {
     _options             = options.Value;
     _logger              = logger;
     _fs                  = fs;
     _installationService = installationService;
 }
示例#2
0
        public ConnectionManager(IRSettings settings, IRInteractiveWorkflowVisual interactiveWorkflow)
        {
            _sessionProvider     = interactiveWorkflow.RSessions;
            _settings            = settings;
            _interactiveWorkflow = interactiveWorkflow;
            _services            = interactiveWorkflow.Services;
            _containers          = interactiveWorkflow.Containers;
            _securityService     = _services.GetService <ISecurityService>();
            _log = _services.GetService <IActionLog>();
            _installationService = _services.GetService <IRInstallationService>();
            _services.GetService <IContainerService>();

            _disposableBag = DisposableBag.Create <ConnectionManager>()
                             .Add(() => _sessionProvider.BrokerStateChanged        -= BrokerStateChanged)
                             .Add(() => _interactiveWorkflow.RSession.Connected    -= SessionConnected)
                             .Add(() => _interactiveWorkflow.RSession.Disconnected -= SessionDisconnected)
                             .Add(() => _interactiveWorkflow.ActiveWindowChanged   -= ActiveWindowChanged)
                             .Add(_containers.SubscribeOnChanges(ContainersChanged));

            _sessionProvider.BrokerStateChanged        += BrokerStateChanged;
            _interactiveWorkflow.RSession.Connected    += SessionConnected;
            _interactiveWorkflow.RSession.Disconnected += SessionDisconnected;
            _interactiveWorkflow.ActiveWindowChanged   += ActiveWindowChanged;

            // Get initial values
            var connections = CreateConnectionList();

            _connections = new ConcurrentDictionary <string, IConnection>(connections);

            UpdateRecentConnections(save: false);
        }
示例#3
0
 public RemoteBrokerProcess(string name, string logFolder, IFileSystem fileSystem, IRInstallationService installations, IProcessServices processServices)
 {
     _name            = name;
     _logFolder       = logFolder;
     _fileSystem      = fileSystem;
     _installations   = installations;
     _processServices = processServices;
     _rhostDirectory  = Path.GetDirectoryName(typeof(RHost).Assembly.GetAssemblyPath());
     Password         = Guid.NewGuid().ToString();
 }
        public ConnectionManagerViewModel(IConnectionManager connectionManager, IServiceContainer services) :
            base(connectionManager, services)
        {
            _ui                  = services.UI();
            _settings            = services.GetService <IRSettings>();
            _installationService = services.GetService <IRInstallationService>();

            _remoteConnections = new BatchObservableCollection <IConnectionViewModel>();
            RemoteConnections  = new ReadOnlyObservableCollection <IConnectionViewModel>(_remoteConnections);

            _localConnections = new BatchObservableCollection <IConnectionViewModel>();
            LocalConnections  = new ReadOnlyObservableCollection <IConnectionViewModel>(_localConnections);

            IsConnected = connectionManager.IsConnected;
            UpdateConnections();
        }
示例#5
0
        public ConnectionManager(IStatusBar statusBar, IRSettings settings, IRInteractiveWorkflowVisual interactiveWorkflow)
        {
            _statusBar           = statusBar;
            _sessionProvider     = interactiveWorkflow.RSessions;
            _settings            = settings;
            _interactiveWorkflow = interactiveWorkflow;
            _shell               = interactiveWorkflow.Shell;
            _securityService     = _shell.GetService <ISecurityService>();
            _log                 = _shell.GetService <IActionLog>();
            _installationService = _shell.GetService <IRInstallationService>();

            _statusBarViewModel = new ConnectionStatusBarViewModel(this, interactiveWorkflow.Shell.Services);
            if (settings.ShowHostLoadMeter)
            {
                _hostLoadIndicatorViewModel =
                    new HostLoadIndicatorViewModel(_sessionProvider, interactiveWorkflow.Shell.MainThread());
            }

            _disposableBag = DisposableBag.Create <ConnectionManager>()
                             .Add(_statusBarViewModel)
                             .Add(_hostLoadIndicatorViewModel ?? Disposable.Empty)
                             .Add(() => _sessionProvider.BrokerStateChanged        -= BrokerStateChanged)
                             .Add(() => _interactiveWorkflow.RSession.Connected    -= SessionConnected)
                             .Add(() => _interactiveWorkflow.RSession.Disconnected -= SessionDisconnected)
                             .Add(() => _interactiveWorkflow.ActiveWindowChanged   -= ActiveWindowChanged);

            _sessionProvider.BrokerStateChanged += BrokerStateChanged;

            _interactiveWorkflow.RSession.Connected    += SessionConnected;
            _interactiveWorkflow.RSession.Disconnected += SessionDisconnected;
            _interactiveWorkflow.ActiveWindowChanged   += ActiveWindowChanged;

            // Get initial values
            var connections = CreateConnectionList();

            _connections = new ConcurrentDictionary <string, IConnection>(connections);

            UpdateRecentConnections(save: false);
            CompleteInitializationAsync().DoNotWait();
        }