创建类时,默认情况下会添加这些名称空间:
using System; using System.Collections.Generic; using System.Linq; using System.Text;我想修改现有项目或我的自定义项目模板,以便在创建新类时添加其他用法。
(而不是必须为每个类手动添加它们。当然,“CTRL +。”用于为类添加命名空间,但它不适用于扩展方法。)
These namespaces are added per default when a class is created:
using System; using System.Collections.Generic; using System.Linq; using System.Text;I want to modify existing projects or my custom project template so that additional usings are added when a new class is created.
(Instead of having to add them manually for every class. Sure, "CTRL + ." works to add namespaces for classes, but it do not work for extension methods.)
最满意答案
转到%ProgramFiles\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplatesCache\CSharp\Code\1033\Class.zip\并编辑Class1.cs和其他文件。
另请参阅%ProgramFiles\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplatesCache\..
我理解你的问题。 您需要与Visual Basic项目属性相同的行为 - Imports带来。
对于C# - 这是不可能的。
Go to %ProgramFiles\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplatesCache\CSharp\Code\1033\Class.zip\ and edit Class1.cs and other files by analogy.
Also see %ProgramFiles\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplatesCache\..
I understand your question. You want the same behavior as Visual Basic project properties - Imports brings.
For C# - this is not possible.
更多推荐
发布评论