Writing a Visual Studio extension for a custom designer

给你一囗甜甜゛ 提交于 2019-12-04 19:49:10

问题


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. Is this kind of thing readily handled in the visual studio extensibility tools? If so where should I start looking to learn how to do this?


回答1:


It's absolutely possible using the Visual Studio Extensibility tools. You'll want to create a VS Package. 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. 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. 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. 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. A few I've used are MSDN and DiveDeeper's VSX blog. 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!

Good luck!



来源:https://stackoverflow.com/questions/2178022/writing-a-visual-studio-extension-for-a-custom-designer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!