如何自定义VS 2008数据库项目模板? [英] How does one customize VS 2008 Database Item Templates?

查看:80
本文介绍了如何自定义VS 2008数据库项目模板?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尽管在MSDN中有一组内容丰富的页面描述了Visual Studio的代码项目(项目和项目)模板,但似乎没有数据库项目.如果我错了,请引导我朝正确的方向前进.我有VS2008 Professional.

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项目项

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

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

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

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

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?

此外,默认模板New Stored Procedure Script.sql实际上在对话框中显示为"Stored Procedure Script".如果我将新存储过程Script.sql"复制并粘贴为特殊存储过程Script.sql"而不做任何其他操作,则会显示带有与原始图标不同的图标的新项,并且在选中并添加后会按预期进入项目.但是,如何使图标与默认图标相同,如何使对话框中项目的名称成为我自己选择的名称而不是文件名呢? ReplyQuote

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

推荐答案

这应该回答您的问题: http://msdn.microsoft.com/zh-cn/library/bb166192.aspx (模板目录说明(.Vsdir)文件)

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

这篇关于如何自定义VS 2008数据库项目模板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆