public IMouseProcessor GetAssociatedProcessor(IWpfTextView view) { var buffer = view.TextBuffer; IOleCommandTarget shellCommandDispatcher = GetShellCommandDispatcher(view); if (shellCommandDispatcher == null) { return(null); } ITelemetrySession telemetrySession = TelemetrySessionForPPT.Create(typeof(GoToDefMouseHandler).Assembly); IVsExtensionManager manager = _globalServiceProvider.GetService(typeof(SVsExtensionManager)) as IVsExtensionManager; if (manager == null) { return(null); } IInstalledExtension extension; manager.TryGetInstalledExtension("GoToDef", out extension); if (extension != null) { return(null); } return(new GoToDefMouseHandler(view, shellCommandDispatcher, telemetrySession, _aggregatorFactory.GetClassifier(buffer), _navigatorService.GetTextStructureNavigator(buffer), CtrlKeyState.GetStateForView(view))); }
public InformationBarMargin(IWpfTextView textView, ITextDocument document, IEditorOperations editorOperations, ITextUndoHistory undoHistory) { _textView = textView; _document = document; _operations = editorOperations; _undoHistory = undoHistory; _telemetrySession = TelemetrySessionForPPT.Create(this.GetType().Assembly); var informationBar = new InformationBarControl(); informationBar.Tabify.Click += Tabify; informationBar.Untabify.Click += Untabify; informationBar.Hide.Click += Hide; informationBar.DontShowAgain.Click += DontShowAgain; this.Height = 0; this.Content = informationBar; this.Name = MarginName; document.FileActionOccurred += FileActionOccurred; // Delay the initial check until the view gets focus. textView.GotAggregateFocus += GotAggregateFocus; }
private static void LogTipClosed(object sender, DependencyPropertyChangedEventArgs e) { FrameworkElement context = sender as FrameworkElement; if ((context != null) && !context.IsVisible) { context.IsVisibleChanged -= LogTipClosed; DateTime now = DateTime.UtcNow; StructureMarginElement.s_elapsedTime += (now - StructureMarginElement.s_lastTimeChanged); StructureMarginElement.s_lastTimeChanged = now; if ((!StructureMarginElement.s_logged) && (StructureMarginElement.s_elapsedTime > StructureMarginElement.s_tipReportingDelay)) { if (StructureMarginElement.s_telemetrySession == null) { StructureMarginElement.s_telemetrySession = TelemetrySessionForPPT.Create(typeof(StructureMarginElement).Assembly); } StructureMarginElement.s_telemetrySession.PostEvent(StructureMarginElement.s_lastKey); StructureMarginElement.s_elapsedTime = TimeSpan.Zero; StructureMarginElement.s_logged = true; } } }
public void VsTextViewCreated(IVsTextView textViewAdapter) { IWpfTextView textView = editorAdaptersFactoryService.GetWpfTextView(textViewAdapter); ITextUndoHistory undoHistory = undoHistoryRegistry.RegisterHistory(textView.TextBuffer); IEditorOperations editorOperations = editorOperationsFactoryService.GetEditorOperations(textView); IEditorOptions editorOptions = editorOptionsFactoryService.GetOptions(textView); IViewPrimitives viewPrimitives = editorPrimitivesFactoryService.GetViewPrimitives(textView); if (_telemetrySession == null) { _telemetrySession = TelemetrySessionForPPT.Create(this.GetType().Assembly); } // Object will survive since it adds itself to the view's command filter chain new CommandFilter( textViewAdapter, textView, htmlBuilderService, rtfBuilderService, editorOperations, undoHistory, editorOptions, viewPrimitives, _telemetrySession); }
public IMouseProcessor GetAssociatedProcessor(IWpfTextView textView) { if (_telemetrySession == null) { _telemetrySession = TelemetrySessionForPPT.Create(this.GetType().Assembly); } return(MiddleClickScroll.Create(textView, _telemetrySession)); }
public ToolsOptionsPage() { _telemetrySession = TelemetrySessionForPPT.Create(this.GetType().Assembly); BeforeCodeSnippet = _beforeCodeSnippetDefault; AfterCodeSnippet = _afterCodeSnippetDefault; Space = _spaceDefault; ReplaceLineBreaksWithBR = _replaceLineBreaksWithBRDefault; ReplaceTabsWithSpaces = _replaceTabsWithSpacesDefault; UnindentToRemoveExtraLeadingWhitespace = _unindentToRemoveExtraLeadingWhitespaceDefault; EmitSpanClass = _emitSpanClassDefault; EmitSpanStyle = _emitSpanStyleDefault; Instance = this; }
protected override void Initialize() { base.Initialize(); // Log telemetry on the initial settings values OptionsPagePackage.TelemetrySession = TelemetrySessionForPPT.Create(this.GetType().Assembly); IEditorOptions globalOptions = (Common.GetMefService <IEditorOptionsFactoryService>()).GlobalOptions; foreach (object option in OptionsPage.Options) { var definition = option as LabeledOptionDefinition; if (definition != null) { if (globalOptions.IsOptionDefined(definition.Name, localScopeOnly: true)) { var value = globalOptions.GetOptionValue <bool>(definition.Name); OptionsPagePackage.TelemetrySession.PostEvent("VS/PPT-Options/OptionInitialValue", definition.Name, value); } } } }
public void VsTextViewCreated(IVsTextView textViewAdapter) { IWpfTextView textView = _editorFactory.GetWpfTextView(textViewAdapter); if (textView == null) { return; } if (_telemetrySession == null) { _telemetrySession = TelemetrySessionForPPT.Create(this.GetType().Assembly); } IOleCommandTarget next; var commandFilter = new CommandFilter(textView, _peekBroker, _telemetrySession); int hr = textViewAdapter.AddCommandFilter(commandFilter, out next); if (next != null) { commandFilter.Next = next; } }