如何扩展 Visual Studio 以提供类似覆盖的行为?

发布于 2024-09-18 21:49:07 字数 122 浏览 5 评论 0 原文

当您在 VS 中的 C# 文件中键入 override 关键字并按空格键时,您会看到第二个菜单,提供要覆盖的方法。我可以使用自己的自定义代码来扩展此行为,该代码将使用另一个关键字来弹出我自己的操作列表吗?

When you type the override keyword in a C# file in VS and press Space, you get a second menu offering the method to override. Can I extend this behavior with my own custom code that would use another keyword to pop up my own list of actions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夜还是长夜 2024-09-25 21:49:07

是的,可以使用更多关键字来扩充列表,甚至可以完全创建自己的列表。您在 Visual Studio 2010 中寻找的接口是 ICompletionSource。虽然这不是一个简单的界面,并且很难在 stackoverflow 答案中提供完整的示例,但网上有大量示例可供查看。

我认为最好的起点是 codeplex 上提供的编辑器示例

Yes it is possible to augment the list with more keywords or to even create your own list entirely. The interface you are looking for in Visual Studio 2010 is ICompletionSource. This isn't a simple interface though and it's hard to give a full sample in a stackoverflow answer but there are plenty of samples online to take a look at.

I think the best place to start is the editor samples available on codeplex

合约呢 2024-09-25 21:49:07

您还想使用什么其他关键字?如果是 C#,按 ctrl+space 将打开自动完成/智能感知菜单。

如果这是为了使用 Visual Studio 编写另一种语言,则可能是 视频很有用。

这是扩展 Visual Studio 起始页,以防有帮助。

What other keyword do you want to use? If it's C#, pressing ctrl+space will open the auto-complete/intellisense menu.

If this is for writing another language using Visual Studio, perhaps this video is of use.

Here's the extending Visual Studio start page, in case it's helpful.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文