如何用非文本信息扩充Visual Studio C#编辑器?

编程入门 行业动态 更新时间:2024-10-09 12:25:11
本文介绍了如何用非文本信息扩充Visual Studio C#编辑器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我遇到过Visual Studio C#编辑器显示额外的UI和/或数据的情况:

I've come across cases where the Visual Studio C# editor displays extra UI and/or data:

  • 引入了调试器断点配置在VS 2015中-请参见此处。
  • Ozcode ,
  • The debugger breakpoints configuration introduced in VS 2015 - see here.
  • Ozcode, which augments the editor with debug-time values.

我想做类似的事情,但不知道哪个Visual Studio使用的API。我遇到过这些Visual Studio可扩展性技术:

I'd like to do something similar, but don't know which Visual Studio APIs to use. I've come across these Visual Studio extensibility technologies:

  • 调试器可视化器:允许使用C#编写自定义可视化器,但似乎要求输出位于模式弹出对话框中。因此,这似乎不是正确的框架。
  • 投影缓冲区:似乎很有希望,但不确定是否可以将其用于增强主编辑器窗口,而不是创建完全自定义的窗口编辑器窗口。
  • Debugger Visualizers: allows a custom visualizer to be written in C#, but seems to require the output to be in a modal pop-up dialog. Therefore this does not seem to be the right framework.
  • Projection Buffers: Seems promising but not sure if this is can be used to augment the primary editor window, as opposed to creating an entirely custom editor window.

所以问题是,我该如何编写在调试时将自定义调试信息添加到Visual Studio编辑器的代码?

So the question is, how can I write code that adds custom debug information to a Visual Studio editor at debug time?

推荐答案

查看 Editor Text Adornment (编辑器文本修饰符),该操作相对于单个字符和文本在文本中添加WPF视觉效果编辑器视口装饰,可将UI添加到文本编辑器本身。

Look at Editor Text Adornment that adds WPF visuals within the text, relative to individual characters and Editor Viewport Adornment that adds UI to the text editor itself.

有关示例,请参见文本内装饰示例和键入速度表示例。

更多推荐

如何用非文本信息扩充Visual Studio C#编辑器?

本文发布于:2023-05-31 14:01:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/393036.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:编辑器   如何用   文本   信息   Visual

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!