public ConnectionManager(IStatusBar statusBar, IRSettings settings, IRInteractiveWorkflow interactiveWorkflow) { _statusBar = statusBar; _sessionProvider = interactiveWorkflow.RSessions; _settings = settings; _interactiveWorkflow = interactiveWorkflow; _shell = interactiveWorkflow.Shell; _securityService = _shell.Services.Security; _statusBarViewModel = new ConnectionStatusBarViewModel(this, interactiveWorkflow.Shell); _hostLoadIndicatorViewModel = new HostLoadIndicatorViewModel(_sessionProvider, interactiveWorkflow.Shell); _disposableBag = DisposableBag.Create<ConnectionManager>() .Add(_statusBarViewModel) .Add(_hostLoadIndicatorViewModel) .Add(() => _sessionProvider.BrokerStateChanged -= BrokerStateChanged) .Add(() => _interactiveWorkflow.ActiveWindowChanged -= ActiveWindowChanged); _sessionProvider.BrokerStateChanged += BrokerStateChanged; _interactiveWorkflow.ActiveWindowChanged += ActiveWindowChanged; // Get initial values var connections = CreateConnectionList(); _connections = new ConcurrentDictionary<string, IConnection>(connections); UpdateRecentConnections(save: false); CompleteInitializationAsync().DoNotWait(); }
public RProjectLoadHooks(UnconfiguredProject unconfiguredProject , [ImportMany("Microsoft.VisualStudio.ProjectSystem.Microsoft.VisualStudio.Shell.Interop.IVsProject")] IEnumerable<Lazy<IVsProject>> cpsIVsProjects , IProjectLockService projectLockService , IRInteractiveWorkflowProvider workflowProvider , IInteractiveWindowComponentContainerFactory componentContainerFactory , IRToolsSettings toolsSettings , IThreadHandling threadHandling , ISurveyNewsService surveyNews , [Import(AllowDefault = true)] IProjectItemDependencyProvider dependencyProvider , ICoreShell coreShell) { _unconfiguredProject = unconfiguredProject; _cpsIVsProjects = cpsIVsProjects; _projectLockService = projectLockService; _workflowProvider = workflowProvider; _toolsSettings = toolsSettings; _threadHandling = threadHandling; _surveyNews = surveyNews; _dependencyProvider = dependencyProvider; _coreShell = coreShell; _projectDirectory = unconfiguredProject.GetProjectDirectory(); unconfiguredProject.ProjectRenamedOnWriter += ProjectRenamedOnWriter; unconfiguredProject.ProjectUnloading += ProjectUnloading; _fileWatcher = new MsBuildFileSystemWatcher(_projectDirectory, "*", 25, 1000, _coreShell.Services.FileSystem, new RMsBuildFileSystemFilter(), coreShell.Services.Log); _fileWatcher.Error += FileWatcherError; Project = new FileSystemMirroringProject(unconfiguredProject, projectLockService, _fileWatcher, _dependencyProvider, coreShell.Services.Log); }
public ConnectionManagerControl(ICoreShell coreShell) { InitializeComponent(); var theme = coreShell.ExportProvider.GetExportedValue<IThemeUtilities>(); theme.SetImageBackgroundColor(this, Brushes.ToolWindowBackgroundColorKey); theme.SetThemeScrollBars(this); }
public void LaunchRClientSetup(ICoreShell coreShell, IFileDownloader downloader = null) { coreShell.Services.Telemetry.ReportEvent(TelemetryArea.Configuration, RtvsTelemetry.ConfigurationEvents.RClientInstallYes); downloader = downloader ?? new FileDownloader(); string downloadError = null; var rClientExe = Path.Combine(Path.GetTempPath(), "RClientSetup.exe"); LongOperationNotification.ShowWaitingPopup(Resources.DownloadingRClientInstaller, new LongAction[] { new LongAction() { Name = Resources.DownloadingRClientInstaller, Action = (o, ct) => { downloadError = downloader.Download("http://go.microsoft.com/fwlink/?LinkId=800048", rClientExe, ct); }, }, }, coreShell.Services.Log); if (!string.IsNullOrEmpty(downloadError)) { var errorMessage = string.Format(CultureInfo.InvariantCulture, Resources.Error_UnableToDownloadRClient, downloadError); coreShell.ShowErrorMessage(errorMessage); coreShell.Services.Telemetry.ReportEvent(TelemetryArea.Configuration, RtvsTelemetry.ConfigurationEvents.RClientDownloadFailed, errorMessage); coreShell.Services.Log.WriteAsync(LogVerbosity.Minimal, MessageCategory.Error, "Microsoft R Client download error: " + errorMessage).DoNotWait(); } else { // Suppress 'Operation canceled by the user' if user clicks 'No' to elevation dialog. try { coreShell.ShowMessage(Resources.PleaseRestartVisualStudioAfterRClientSetup, MessageButtons.OK); coreShell.Services.ProcessServices.Start(rClientExe); } catch (Win32Exception ex) { if((uint)ex.NativeErrorCode == 0x800704C7) { coreShell.Services.Telemetry.ReportEvent(TelemetryArea.Configuration, RtvsTelemetry.ConfigurationEvents.RClientInstallCancel); } } } }
public GotoBraceCommand(ITextView textView, ITextBuffer textBuffer, ICoreShell shell) : base(textView, _commands, false) { var importComposer = new ContentTypeImportComposer<IBraceMatcherProvider>(shell.CompositionService); _braceMatcherProvider = importComposer.GetImport(textBuffer.ContentType.TypeName); TextBuffer = textBuffer; }
public TreeValidator(IEditorTree editorTree, ICoreShell shell) { #if DEBUG TraceValidation.Enabled = false; #endif _editorTree = editorTree; _editorTree.NodesRemoved += OnNodesRemoved; _editorTree.UpdateCompleted += OnTreeUpdateCompleted; _editorTree.Closing += OnTreeClose; _shell = shell; _syntaxCheckEnabled = IsSyntaxCheckEnabled(_editorTree.TextBuffer); // Advise to settings changed *after* accessing the RSettings, // since accessing the host application (VS) settings object may // cause it fire Changed notification in some cases. REditorSettings.Changed += OnSettingsChanged; // We don't want to start validation right away since it may // interfere with the editor perceived startup performance. StartValidationNextIdle(); ValidationResults = new ConcurrentQueue<IValidationError>(); ServiceManager.AddService<TreeValidator>(this, editorTree.TextBuffer, shell); }
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 InternalFunctionPeekResultSource(string sourceFileName, Span sourceSpan, string functionName, InternalFunctionPeekItem peekItem, ICoreShell shell) { _peekItem = peekItem; _shell = shell; // Start asynchronous function fetching so by the time FindResults // is called the task may be already completed or close to that. LookupTask = FindFunctionAsync(sourceFileName, sourceSpan, functionName); }
public static CommandTargetProxy GetProxyTarget(ITextView textView, ICoreShell coreShell) { var proxy = ServiceManager.GetService<CommandTargetProxy>(textView); if (proxy == null) { proxy = new CommandTargetProxy(textView, coreShell); } return proxy; }
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; }
/// <summary> /// Create delayed idle time action /// </summary> /// <param name="action">Action to execute on idle</param> /// <param name="delay">Minimum number of milliseconds to wait before executing the action</param> /// <param name="tag">Object that uniquely identifies the action. Typically creator object.</param> /// <param name="shell"></param> public static void Create(Action action, int delay, object tag, ICoreShell shell) { IdleTimeAction existingAction; if (!_idleActions.TryGetValue(tag, out existingAction)) { existingAction = new IdleTimeAction(action, delay, tag, shell); _idleActions[tag] = existingAction; } }
private IdleTimeAction(Action action, int delay, object tag, ICoreShell shell) { _action = action; _delay = delay; _tag = tag; _shell = shell; ConnectToIdle(); }
public HostLoadIndicatorViewModel(IRSessionProvider sessionProvider, ICoreShell shell) { _sessionProvider = sessionProvider; _shell = shell; _disposableBag = DisposableBag.Create<HostLoadIndicatorViewModel>() .Add(() => _sessionProvider.HostLoadChanged -= OnHostLoadChanged); _sessionProvider.HostLoadChanged += OnHostLoadChanged; }
public static EditorTree MakeTree(ICoreShell coreShell, string expression) { TextBufferMock textBuffer = new TextBufferMock(expression, RContentTypeDefinition.ContentType); var tree = new EditorTree(textBuffer, coreShell); tree.Build(); return tree; }
public RSuggestedActionSource(ITextView textView, ITextBuffer textBuffer, IEnumerable<IRSuggestedActionProvider> suggestedActionProviders, ICoreShell shell) { _textBuffer = textBuffer; _textView = textView; _textView.Caret.PositionChanged += OnCaretPositionChanged; _suggestedActionProviders = suggestedActionProviders; _document = REditorDocument.TryFromTextBuffer(_textBuffer); ServiceManager.AddService(this, _textView, shell); }
public SProcGeneratorTest(PackageTestFilesFixture files) { _files = files; _coreShell = Substitute.For<ICoreShell>(); _pss = Substitute.For<IProjectSystemServices>(); _project = Substitute.For<EnvDTE.Project>(); _project.FullName.Returns(Path.Combine(_files.DestinationPath, sqlProjectName)); }
public VsRInteractiveWindowComponentContainerFactory( Lazy<IVsInteractiveWindowFactory> vsInteractiveWindowFactory, IContentTypeRegistryService contentTypeRegistryService, ICoreShell shell) { _vsInteractiveWindowFactoryLazy = vsInteractiveWindowFactory; _contentTypeRegistryService = contentTypeRegistryService; _shell = shell; }
public static MdMainController Attach(ITextView textView, ITextBuffer textBuffer, ICoreShell coreShell) { MdMainController controller = FromTextView(textView); if (controller == null) { controller = new MdMainController(textView, textBuffer, coreShell); } return controller; }
public TreeUpdateTask(EditorTree editorTree, ICoreShell shell) { _editorTree = editorTree; _shell = shell; if (_shell != null) { _shell.Idle += OnIdle; } }
public static ISuggestedActionsSource FromViewAndBuffer(ITextView textView, ITextBuffer textBuffer, ICoreShell shell) { var suggestedActionsSource = ServiceManager.GetService<RSuggestedActionSource>(textView); if (suggestedActionsSource == null) { IEnumerable<IRSuggestedActionProvider> suggestedActionProviders = ComponentLocator<IRSuggestedActionProvider>.ImportMany(shell.CompositionService).Select(p => p.Value); suggestedActionsSource = new RSuggestedActionSource(textView, textBuffer, suggestedActionProviders, shell); } return suggestedActionsSource; }
public void Initialize(ITextView view, IEditorOperations editorOperations, ITextBufferUndoManager undoManager, ICoreShell coreShell) { Debug.Assert(view != null, "view must not be null"); Debug.Assert(editorOperations != null, "editor operations must not be null"); _view = view; _editorOperations = editorOperations; _undoManager = undoManager; _braceCompletionTarget = new BraceCompletionCommandTarget(view, coreShell); }
/// <summary> /// Creates contained language host with default settings. /// </summary> /// <param name="document">Markdown editor document</param> /// <param name="textBuffer">Contained language text buffer</param> /// <param name="coreShell"></param> public MdContainedLanguageHost(IEditorDocument document, ITextBuffer textBuffer, ICoreShell coreShell) { _textBuffer = textBuffer; _coreShell = coreShell; _document = document; _document.DocumentClosing += OnDocumentClosing; ServiceManager.AddService<IContainedLanguageHost>(this, textBuffer, coreShell); }
public RInteractiveEvaluator(IRSession session, IRHistory history, ICoreShell coreShell, IRSettings settings) { History = history; Session = session; Session.Output += SessionOnOutput; Session.Disconnected += SessionOnDisconnected; Session.BeforeRequest += SessionOnBeforeRequest; _coreShell = coreShell; _settings = settings; }
public SettingsPageViewModel(IConfigurationSettingCollection settings, ICoreShell coreShell, IFileSystem fileSystem) { Check.ArgumentNull(nameof(settings), settings); Check.ArgumentNull(nameof(coreShell), coreShell); Check.ArgumentNull(nameof(fileSystem), fileSystem); _settings = settings; _coreShell = coreShell; _fileSystem = fileSystem; }
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; }
public MdEditorDocument(ITextBuffer textBuffer, IProjectionBufferFactoryService projectionBufferFactoryService, IContentTypeRegistryService contentTypeRegistryService, ICoreShell coreShell) { this.TextBuffer = textBuffer; ServiceManager.AddService(this, TextBuffer, coreShell); _projectionBufferManager = new ProjectionBufferManager(textBuffer, projectionBufferFactoryService, contentTypeRegistryService, coreShell, MdProjectionContentTypeDefinition.ContentType, RContentTypeDefinition.ContentType); ContainedLanguageHandler = _rLanguageHandler = new RLanguageHandler(textBuffer, _projectionBufferManager, coreShell); }
public RSessionCallback(IInteractiveWindow interactiveWindow, IRSession session, IRSettings settings, ICoreShell coreShell, IFileSystem fileSystem) { _interactiveWindow = interactiveWindow; _session = session; _settings = settings; _coreShell = coreShell; _fileSystem = fileSystem; var workflowProvider = _coreShell.ExportProvider.GetExportedValue<IRInteractiveWorkflowProvider>(); _workflow = workflowProvider.GetOrCreate(); }
public ConnectionStatusBarViewModel(IConnectionManager connectionManager, ICoreShell shell) { _connectionManager = connectionManager; _shell = shell; _disposableBag = DisposableBag.Create<ConnectionStatusBarViewModel>() .Add(() => connectionManager.ConnectionStateChanged -= ConnectionStateChanged); connectionManager.ConnectionStateChanged += ConnectionStateChanged; IsConnected = connectionManager.IsConnected; SelectedConnection = connectionManager.ActiveConnection?.Name; }
public QuickInfoController(ITextView textView, IList<ITextBuffer> subjectBuffers, IQuickInfoBroker quickInfoBroker, ICoreShell shell) { _quickInfoBroker = quickInfoBroker; _textView = textView; _subjectBuffers = subjectBuffers; _shell = shell; _textView.MouseHover += OnViewMouseHover; _textView.TextBuffer.Changing += OnTextBufferChanging; ServiceManager.AddService(this, textView, shell); }
private RCompletionController( ITextView textView, IList<ITextBuffer> subjectBuffers, ICompletionBroker completionBroker, IQuickInfoBroker quickInfoBroker, ISignatureHelpBroker signatureBroker, ICoreShell shell) : base(textView, subjectBuffers, completionBroker, quickInfoBroker, signatureBroker, shell) { _textBuffer = subjectBuffers[0]; ServiceManager.AddService<RCompletionController>(this, TextView, shell); }
public VsRTextViewConnectionListener(ICoreShell coreShell) : base(coreShell.Services) { _adapterService = coreShell.GetService <IVsEditorAdaptersFactoryService>(); }
public RSuggestedActionSource(ITextView textView, ITextBuffer textBuffer, IEnumerable <IRSuggestedActionProvider> suggestedActionProviders, ICoreShell shell) { _textBuffer = textBuffer; _textView = textView; _textView.Caret.PositionChanged += OnCaretPositionChanged; _suggestedActionProviders = suggestedActionProviders; _document = REditorDocument.TryFromTextBuffer(_textBuffer); ServiceManager.AddService(this, _textView, shell); }
public static MdMainController Attach(ITextView textView, ITextBuffer textBuffer, ICoreShell coreShell) { MdMainController controller = FromTextView(textView); if (controller == null) { controller = new MdMainController(textView, textBuffer, coreShell); } return(controller); }
public static async Task ShowErrorMessageAsync(this ICoreShell coreShell, string message, CancellationToken cancellationToken = default(CancellationToken)) { await coreShell.SwitchToMainThreadAsync(cancellationToken); coreShell.ShowErrorMessage(message); }
public SettingPropertyDescriptor(ICoreShell coreShell, IConfigurationSetting setting) : base(setting.Name, null) { _coreShell = coreShell; Setting = setting; }
public DacPackageServicesProvider(ICoreShell coreShell, IFileExtensionRegistryService fers, IContentTypeRegistryService ctrs) { _coreShell = coreShell; _fers = fers; _ctrs = ctrs; }
public RLanguageHandler(ITextBuffer textBuffer, IProjectionBufferManager projectionBufferManager, ICoreShell coreShell) : base(textBuffer, coreShell) { _projectionBufferManager = projectionBufferManager; _coreShell = coreShell; UpdateProjections(); }
public ParameterNameCompletionProvider(ICoreShell shell) { _shell = shell; }
public CommonControllerFactory(ICoreShell shell) { _shell = shell; }
public InteractiveWindowConsole(ICoreShell coreShell, Lazy <IRInteractiveWorkflow> workflowLazy) { _coreShell = coreShell; _workflowLazy = workflowLazy; }
public InteractiveWindowComponentContainerFactoryMock(ICoreShell shell) { _shell = shell; }
public ManageDsnCommand(ICoreShell shell, IRInteractiveWorkflow workflow) : base(RPackageCommandId.icmdManageDsn, workflow) { _shell = shell; }
public SwitchToConnectionCommand(IRInteractiveWorkflow workflow, IRSettings settings) { _settings = settings; _connectionManager = workflow.Connections; _shell = workflow.Shell; }
public VsRHistoryTextViewConnectionListener(ICoreShell coreShell) : base(coreShell.Services) { }
public ContentTypeServiceLocator(ICoreShell coreShell) { _compositionService = coreShell.GetService <ICompositionService>(); _ctrs = coreShell.GetService <IContentTypeRegistryService>(); }
public RInteractiveEvaluator(IRSessionProvider sessionProvider, IRSession session, IRHistory history, IConnectionManager connections, ICoreShell coreShell, IRSettings settings, IConsole console) { History = history; Session = session; _sessionProvider = sessionProvider; _connections = connections; _coreShell = coreShell; _settings = settings; _console = console; _evaluatorRequest = new CountdownDisposable(); _fs = _coreShell.FileSystem(); _disposableBag .Add(() => Session.Output -= SessionOnOutput) .Add(() => Session.Connected -= SessionOnConnected) .Add(() => Session.Disconnected -= SessionOnDisconnected) .Add(() => Session.BeforeRequest -= SessionOnBeforeRequest) .Add(() => Session.AfterRequest -= SessionOnAfterRequest) .Add(() => _sessionProvider.BrokerChanged -= OnBrokerChanging); _sessionProvider.BrokerChanging += OnBrokerChanging; Session.Output += SessionOnOutput; Session.Connected += SessionOnConnected; Session.Disconnected += SessionOnDisconnected; Session.BeforeRequest += SessionOnBeforeRequest; Session.AfterRequest += SessionOnAfterRequest; }
public TestRInteractiveWindowComponentContainerFactory(IInteractiveWindowFactoryService interactiveWindowFactory, IContentTypeRegistryService contentTypeRegistryService, ICoreShell shell) { _contentTypeRegistryService = contentTypeRegistryService; _shell = shell; InteractiveWindowFactory = interactiveWindowFactory; }
public SwitchToConnectionCommand(IRInteractiveWorkflow workflow) { _connnectionManager = workflow.Connections; _shell = workflow.Shell; }
public RSuggestedActionsSourceProvider(ICoreShell shell) { _shell = shell; }
public static MainThreadAwaitable SwitchToMainThreadAsync(this ICoreShell coreShell, CancellationToken cancellationToken = default(CancellationToken)) => ((IMainThread)coreShell).SwitchToAsync(cancellationToken);
public RCompletionSourceProvider(ICoreShell shell) { _shell = shell; }
public RSessionCallback(IInteractiveWindow interactiveWindow, IRSession session, IRSettings settings, ICoreShell coreShell, IFileSystem fileSystem) { _interactiveWindow = interactiveWindow; _session = session; _settings = settings; _coreShell = coreShell; _fileSystem = fileSystem; }
public PlotManagerWindowPane(IRPlotManager plotManager, IRSession session, IRSettings settings, ICoreShell coreShell) { _plotManager = plotManager; _session = session; _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 static async Task <MessageButtons> ShowMessageAsync(this ICoreShell coreShell, string message, MessageButtons buttons, CancellationToken cancellationToken = default(CancellationToken)) { await coreShell.SwitchToMainThreadAsync(cancellationToken); return(coreShell.ShowMessage(message, buttons)); }
public TestMdTextViewConnectionListener(ICoreShell coreShell) : base(coreShell.Services) { }
public TestRPackageManagerVisualComponentContainerFactory(ISearchControlProvider searchControlProvider, IRSettings settings, ICoreShell coreShell) { _searchControlProvider = searchControlProvider; _settings = settings; _coreShell = coreShell; }
public RdBraceHighlightProvider(ICoreShell shell) : base(shell) { }
public DocumentationTest(IServiceContainer services, EditorHostMethodFixture editorHost) { _coreShell = services.GetService <ICoreShell>(); _editorHost = editorHost; }
public TreeChangeTypeTest(IExportProvider exportProvider, EditorTestFilesFixture testFiles) { _exportProvider = exportProvider; _coreShell = _exportProvider.GetExportedValue <ICoreShell>(); }
public static ISuggestedActionsSource FromViewAndBuffer(ITextView textView, ITextBuffer textBuffer, ICoreShell shell) { var suggestedActionsSource = ServiceManager.GetService <RSuggestedActionSource>(textView); if (suggestedActionsSource == null) { IEnumerable <IRSuggestedActionProvider> suggestedActionProviders = ComponentLocator <IRSuggestedActionProvider> .ImportMany(shell.CompositionService).Select(p => p.Value); suggestedActionsSource = new RSuggestedActionSource(textView, textBuffer, suggestedActionProviders, shell); } return(suggestedActionsSource); }