简体   繁体   English

如何将 Visual Studio 表单设计器用于其他窗口系统?

[英]How to use the Visual Studio form designer for other windowing systems?

I'm creating a windowing system, comparable to WinForms or WPF, in XNA for a game I'm making.我正在为我正在制作的游戏在 XNA 中创建一个窗口系统,类似于 WinForms 或 WPF。

Now, it would be nice to be able to use the Visual Studio form designer to make my windows.现在,能够使用 Visual Studio 表单设计器来制作我的窗口会很好。

I've googled a bit but I couldn't find anything.我用谷歌搜索了一下,但找不到任何东西。 However, it might be possible because Microsoft uses the same basic designer interface/structure for many different things.但是,这是可能的,因为 Microsoft 对许多不同的事物使用相同的基本设计器界面/结构。 (WinForms designing, WPF designing, Workflow designing, User Control designing, ...) (WinForms 设计,WPF 设计,工作流设计,用户控件设计,...)

Is it possible to achieve this with Visual Studio's plugin system or will I have to make something custom to do it?是否可以使用 Visual Studio 的插件系统来实现这一点,还是我必须定制一些东西才能做到这一点?

我不知道你如何使用 VS,但在开始定制一些东西之前,我建议看看http://sharpdevelop.net/opensource/sd/

Well, you must have a lot of programmers in your team if you intend to reprogram something like the Visual Studio forms designer on your own ;-)好吧,如果您打算自己重新编程 Visual Studio 表单设计器之类的东西,那么您的团队中必须有很多程序员;-)

In fact, I don't know if it will be possible with the VS plugin system, but if I were in your situation, I would use VS to create a Winforms or WPF GUI, and create a code generator which maps the code generated by VS to the classes of your windowing system.事实上,我不知道 VS 插件系统是否可行,但如果我处于你的情况,我会使用 VS 创建一个 Winforms 或 WPF GUI,并创建一个代码生成器来映射生成的代码VS 到您的窗口系统的类。 Most likely you will have to restrict yourself in using Winforms/WPF components for which you provide something similar in your framework.很可能您将不得不限制自己使用您在框架中提供类似内容的 Winforms/WPF 组件。

I have not looked at this for years, but at the time the authoritive article on the topic was Tailor Your Application by Building a Custom Forms Designer with .NET . 我已经好多年没有对此进行研究了,但是当时有关该主题的权威文章是通过使用.NET构建自定义表单设计器来定制应用程序 This will probably still be a good place to start. 这可能仍然是一个不错的起点。

I think it is very complicated things to do but you can do that.我认为这是非常复杂的事情,但你可以做到。 At first you have to know about Visual Studio SDK.首先,您必须了解 Visual Studio SDK。 Usually you have to download separately from the main products.通常您必须与主要产品分开下载。 AFAIK CMIIW it is version dependent. AFAIK CMIIW 它取决于版本。 So if you are installed VS 2010 with SP1 you have to use VS 2010 SP1 SDK.因此,如果您安装了带有 SP1 的 VS 2010,则必须使用 VS 2010 SP1 SDK。 The other you have to choose that is your products is isolated or integrated shell.另一个你必须选择的是你的产品是隔离的还是集成的外壳。 The isolated means your shell will launch on separated vs 2010 instance(not in vs 2010).隔离意味着您的 shell 将在单独的 vs 2010 实例上启动(而不是在 vs 2010 中)。 The example is SQL Server management studio from microsoft itself is isolated.例子是 SQL Server management studio 与微软本身是隔离的。 Integrated shell means your products will integrated in VS 2010. You can see on MSDN in herehttp://msdn.microsoft.com/en-us/library/bb166441(v=VS.100).aspx how to use that SDK.集成外壳意味着您的产品将集成到 VS 2010 中。您可以在 MSDN 上看到http://msdn.microsoft.com/en-us/library/bb166441(v=VS.100).aspx如何使用该 SDK。

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

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