Visual Studio代码编辑器使用了哪个WPF元素?

时间:2022-09-20 15:54:38

According to this post, Visual Studio was rewritten using WPF. I'm trying to figure out what Element is used for the code editor window (specifically C#, if there's a difference) but I can't figure out which element could have all of that functionality (obviously with a lot of extra work. But still...).

根据这篇文章,Visual Studio是用WPF重写的。我试图弄清楚代码编辑器窗口中使用了什么元素(特别是c#,如果有区别的话),但是我不知道哪个元素可以拥有所有这些功能(显然还有很多额外的工作)。但仍然……)。

I want to know this is so that I can experiment writing my own little code editor. (Yes, I know a full-fledged editor is a very large project. I'm talking about a simple custom one.)

我想知道这是为了让我可以尝试编写我自己的小代码编辑器。(是的,我知道一个成熟的编辑是一个非常大的项目。我说的是一个简单的定制。

1 个解决方案

#1


7  

After a quick Snoop I can see that the base element is: Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView so it is very much a custom job.

在快速浏览之后,我可以看到基本元素是:microsoft . visualstudioo.text.editor.implementation。WpfTextView,这是一个自定义作业。

I don't know what access you can get to the libraries but there is documentation around the namespace here:

我不知道你可以访问哪些库,但是这里有关于名称空间的文档:

https://msdn.microsoft.com/en-GB/library/microsoft.visualstudio.text.editor.aspx

https://msdn.microsoft.com/en-GB/library/microsoft.visualstudio.text.editor.aspx

#1


7  

After a quick Snoop I can see that the base element is: Microsoft.VisualStudio.Text.Editor.Implementation.WpfTextView so it is very much a custom job.

在快速浏览之后,我可以看到基本元素是:microsoft . visualstudioo.text.editor.implementation。WpfTextView,这是一个自定义作业。

I don't know what access you can get to the libraries but there is documentation around the namespace here:

我不知道你可以访问哪些库,但是这里有关于名称空间的文档:

https://msdn.microsoft.com/en-GB/library/microsoft.visualstudio.text.editor.aspx

https://msdn.microsoft.com/en-GB/library/microsoft.visualstudio.text.editor.aspx