问题描述
我一直在Visual Studio 2008中使用实现界面"快捷方式.我的问题"是我希望Visual Studio使用 String -alias而不是 string 在每种情况下.
I'm constantly using the "Implement interface" shortcut in Visual Studio 2008. My "problem" is that i want Visual Studio to use the String-alias instead of string in every instance.
由于我被迫使用String而不是string,这将为我节省大量时间.例如,我想要以下内容:
Since i'm forced to use String instead of string this would save me a great ammount of time. For example, i want the following:
public Catalogue(String url) { }
代替
public Catalogue(string url) { }
这可能吗?我在哪里可以找到这些模板?
Is this possible? Where do I find these templates?
推荐答案
您不能更改重构期间使用的模板.
You cannot change the templates used during refactorings.
可以更改的模板位于%ProgramFiles%\ Microsoft Visual Studio 9.0 \ Common7 \ IDE 中.具体来说,大多数用于空白文件的CSharp文件都在%ProgramFiles%\ Microsoft Visual Studio 9.0 \ Common7 \ IDE \ ItemTemplates \ CSharp
Templates that you can change are available in %ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE. Specifically, most of the CSharp ones for blank files and such are in %ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp
如果强迫您使用字符串"的人意识到浪费了多少时间,也许他们会改变他们的方式.我个人不明白这一点...
Maybe the person forcing you to use "String" would change their ways if they realized how much time this wasted. I personally don't understand this...
IDE在所有生成的代码中使用字符串",而不是字符串"-因此,通过强制使用非标准的标准",您的团队会引起不一致.人们可以争论哪种更好,直到脸色变蓝为止.但是,正如您所指出的那样,使用字符串"是一个痛苦的事情.
The IDE uses "string", and not "String" in all generated code - so by forcing a non-standard "standard" your team is inviting inconsistency. People can debate about which is better until they're blue in the face - but as you point out, using "String" is a pain in the ass.
这篇关于更改“实施界面" Visual Studio中的模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!