public VsInteractiveWindowEditorFactoryService(IVsEditorAdaptersFactoryService adaptersFactory, IContentTypeRegistryService contentTypeRegistry, [ImportMany] IEnumerable <Lazy <IVsInteractiveWindowOleCommandTargetProvider, ContentTypeMetadata> > oleCommandTargetProviders) { _adapterFactory = adaptersFactory; _provider = (IOleServiceProvider)InteractiveWindowPackage.GetGlobalService(typeof(IOleServiceProvider)); _contentTypeRegistry = contentTypeRegistry; _oleCommandTargetProviders = oleCommandTargetProviders; }
private void ShowContextMenu() { var uishell = (IVsUIShell)InteractiveWindowPackage.GetGlobalService(typeof(SVsUIShell)); if (uishell != null) { var pt = System.Windows.Forms.Cursor.Position; var position = new[] { new POINTS { x = (short)pt.X, y = (short)pt.Y } }; var guid = Guids.InteractiveCommandSetId; ErrorHandler.ThrowOnFailure(uishell.ShowContextMenu(0, ref guid, (int)MenuIds.InteractiveWindowContextMenu, position, this)); } }
private void SetEditorOptions(IEditorOptions options, Guid languageServiceGuid) { IVsTextManager textMgr = (IVsTextManager)InteractiveWindowPackage.GetGlobalService(typeof(SVsTextManager)); var langPrefs = new LANGPREFERENCES[1]; langPrefs[0].guidLang = languageServiceGuid; ErrorHandler.ThrowOnFailure(textMgr.GetUserPreferences(null, null, langPrefs, null)); options.SetOptionValue(DefaultTextViewHostOptions.ChangeTrackingId, false); options.SetOptionValue(DefaultOptions.ConvertTabsToSpacesOptionId, langPrefs[0].fInsertTabs == 0); options.SetOptionValue(DefaultOptions.TabSizeOptionId, (int)langPrefs[0].uTabSize); options.SetOptionValue(DefaultOptions.IndentSizeOptionId, (int)langPrefs[0].uIndentSize); }