public IWpfTextViewMargin CreateMargin(IWpfTextViewHost wpfTextViewHost, IWpfTextViewMargin marginContainer) { MarkdownPackage package = null; // If there is a shell service (which there should be, in VS), force the markdown package to load IVsShell shell = GlobalServiceProvider.GetService(typeof(SVsShell)) as IVsShell; if (shell != null) { package = MarkdownPackage.ForceLoadPackage(shell); } return(new Margin(wpfTextViewHost.TextView, package)); }
public void TextViewCreated(IWpfTextView textView) { MarkdownPackage package = null; // If there is a shell service (which there should be, in VS), force the markdown package to load IVsShell shell = GlobalServiceProvider.GetService(typeof(SVsShell)) as IVsShell; if (shell != null) { package = MarkdownPackage.ForceLoadPackage(shell); } if (package == null) { return; } textView.Properties.GetOrCreateSingletonProperty(() => new PreviewWindowUpdateListener(textView, package, TextDocumentFactoryService)); }
public void TextViewCreated(IWpfTextView textView) { ITextDocument document; if (!textView.TextDataModel.DocumentBuffer.Properties.TryGetProperty(typeof(ITextDocument), out document)) { document = null; } MarkdownPackage package = null; // If there is a shell service (which there should be, in VS), force the markdown package to load IVsShell shell = GlobalServiceProvider.GetService(typeof(SVsShell)) as IVsShell; if (shell != null) { package = MarkdownPackage.ForceLoadPackage(shell); } textView.Properties.GetOrCreateSingletonProperty(() => new PreviewWindowUpdateListener(textView, package, document)); }