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); }
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; } }
public CommandFilter( IVsTextView textView, IWpfTextView wpfTextView, IHtmlBuilderService htmlBuilderService, IRtfBuilderService rtfBuilderService, IEditorOperations editorOperations, ITextUndoHistory undoHistory, IEditorOptions editorOptions, IViewPrimitives viewPrimitives, ITelemetrySession telemetrySession) { _htmlBuilderService = htmlBuilderService; _rtfBuilderService = rtfBuilderService; _undoHistory = undoHistory; _textView = wpfTextView; _editorOperations = editorOperations; _editorOptions = editorOptions; _viewPrimitives = viewPrimitives; _telemetrySession = telemetrySession; textView.AddCommandFilter(this, out _nextCommandTargetInChain); }
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; }