简体   繁体   English

为自定义设计器编写Visual Studio扩展

[英]Writing a Visual Studio extension for a custom designer

So, I've got something I want to try out. 所以,我有一些我想尝试的东西。 The idea is to have a visual designer that works as a Visual Studio Extension, I want to be able to drag out event handlers and wire up behaviors, anyone who's ever played with the warcraft III script editor will have a pretty good idea what I'm wanting to do. 我的想法是拥有一个可视化设计器作为Visual Studio扩展,我希望能够拖出事件处理程序和连接行为,任何曾经玩过魔兽争霸III脚本编辑器的人都会非常清楚我是什么我想做什么。 Is this kind of thing readily handled in the visual studio extensibility tools? 这种东西在visual studio可扩展性工具中是否容易处理? If so where should I start looking to learn how to do this? 如果是这样,我应该从哪里开始学习如何做到这一点?

It's absolutely possible using the Visual Studio Extensibility tools. 使用Visual Studio Extensibility工具绝对可能。 You'll want to create a VS Package. 您将要创建一个VS包。 There are a few different mechanisms (macros, add-ins, and packages) you can use to extend Visual Studio, but Packages are by far the most powerful. 您可以使用一些不同的机制(宏,加载项和包)来扩展Visual Studio,但包是目前最强大的。 More specifically, you should look into creating a "Custom Editor/Designer" . 更具体地说,您应该考虑创建“自定义编辑器/设计器”

You'll need to download the Visual Studio 2010 SDK if you haven't already. 如果您还没有,则需要下载Visual Studio 2010 SDK。 There's a fantastic wizard for creating new VS Packages which will even generate a sample "Custom editor" that you can use as a starting point for your custom designer. 有一个很棒的向导用于创建新的VS包,甚至可以生成一个示例“自定义编辑器”,您可以将其用作自定义设计器的起点。 I'd recommend reading through the code that the wizard generates until you really understand it. 我建议您阅读向导生成的代码,直到您真正理解它为止。 There's a lot of stuff going on, so it can take a while. 很多东西在进行,所以可能需要一段时间。 If you want a book to get started, pretty much the only one I've found is Professional Visual Studio Extensibility , but there are other good resources on the internet. 如果你想要一本书开始,我发现的唯一一本是Professional Visual Studio Extensibility ,但互联网上还有其他好的资源。 A few I've used are MSDN and DiveDeeper's VSX blog . 我使用的一些是MSDNDiveDeeper的VSX博客 Probably the best way to get started is reading the code samples from the VSX team , they even have about 10-15 samples related to custom editors! 可能最好的入门方法是阅读VSX团队代码示例 ,他们甚至有大约10-15个与自定义编辑器相关的示例!

Good luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM