如何自定义 VS 2008 数据库项模板?

发布于 2024-07-18 04:46:00 字数 1611 浏览 6 评论 0原文

尽管 MSDN 中有一组信息丰富的页面描述了代码项目(项目和项)的 Visual Studio 模板,但似乎没有数据库项目的内容。 如果我错了,请引导我走向正确的方向。 我有VS2008专业版。

无论如何,我的问题与新的数据库项目有关。 目前,文件夹

C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\Templates\Database Project Items

包含 6 个模板文件和另一个文件 NewDataItems.vsdir,该文件似乎有助于控制 VS 如何使用这 6 个模板。 我想为存储过程创建一个新模板,并且我注意到,如果我只是复制默认模板并使用新名称对其进行修改,它确实会显示在“添加新项”对话框中,但它不使用相同的图标和其他项目一样。 它确实有效,但我不禁想知道是否适当修改 NewDataItems.vsdir 文件以包含它,我可以让它看起来与对话框中的其他项目相同。 这是文件的内容:

New Stored Procedure Script.sql|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|#6306|30|#6307|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|1052| |#6320
New View Script.sql|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|#6308|60|#6309|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|1051| |#6320
New Table Script.sql|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|#6310|40|#6311|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|1050| |#6320
New SQL Script.sql|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|#6319|10|#6314|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|1054| |#6320
New Trigger Script.sql|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|#6312|50|#6313|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|1053| |#6320
New Query.dtq|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|#6321|20|#6315|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|1057| |#6322

我不清楚该文件的各个元素的含义,但看起来编号的项目(#6308、30、1052 等)可能控制对话框中演示的某些方面。 有人可以解释该文件的元素以及如何进行更改和添加吗?

此外,默认模板 New Stored procedure Script.sql 实际上在对话框中显示为“Stored procedure Script”。 如果我将新存储过程 Script.sql 复制并粘贴为特殊存储过程 Script.sql,而不执行任何其他操作,则会显示一个图标与原始图标不同的新项目,并且在选择并添加时会按预期进入项目。 但是如何使图标与默认图标相同,以及如何使对话框中的项目名称成为我选择的名称而不是文件名? 回复引用

Whereas there is a set of richly informative pages describing Visual Studio templates for code projects (projects and items) in MSDN, there doesn't seem to be a thing for database projects. If I am wrong, please steer me in the right direction. I have VS2008 Professional.

Anyway, my question has to do with the new database items. Presently, the folder

C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\Templates\Database Project Items

contains 6 template files and one other file, NewDataItems.vsdir, which seems to help control how VS uses these 6 templates. I want to create a new template for stored procedures, and I note that if I merely copy the default template and modify it with a new name, it does show up in the Add New Item dialog, but it doesn't use the same icon as the other items. It does work, but I can't help wondering if I appropriately modify the NewDataItems.vsdir file to include it, I could get it to look the same as the other items in the dialog. Here's the contents of the file:

New Stored Procedure Script.sql|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|#6306|30|#6307|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|1052| |#6320
New View Script.sql|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|#6308|60|#6309|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|1051| |#6320
New Table Script.sql|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|#6310|40|#6311|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|1050| |#6320
New SQL Script.sql|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|#6319|10|#6314|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|1054| |#6320
New Trigger Script.sql|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|#6312|50|#6313|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|1053| |#6320
New Query.dtq|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|#6321|20|#6315|{220A4C17-7E7C-4663-BBCC-5E607C6543CD}|1057| |#6322

It's unclear to me what the various elements of this file are supposed to mean, but it looks like the numbered items (#6308, 30, 1052, etc) may control some aspect of the presentation in the dialog. Can someone explain the elements of this file and how to make changes and additions?

Also, the default template New Stored Procedure Script.sql is actually presented in the dialog as "Stored Procedure Script". If I copy and paste New Stored Procedure Script.sql as Special Stored Procedure Script.sql without doing anything more, a new item with an icon different from the original shows up, and when selected and Added goes into the project as expected. But how do I make the icon the same as for the default, and how do I make the name of the item in the dialog something of my choice rather than the filename?
ReplyQuote

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

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

发布评论

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

评论(1

东风软 2024-07-25 04:46:00

这应该可以回答您的问题:http://msdn.microsoft.com/en- us/library/bb166192.aspx(模板目录描述 (.Vsdir) 文件)

This should answer your questions: http://msdn.microsoft.com/en-us/library/bb166192.aspx (Template Directory Description (.Vsdir) Files)

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