我想写一个Visual Studio代码片段,让我快速创建一个类的形式为:Visual Studio:是否可以定义用于自己的代码片段的自定义函数?
public SomeClass
{
public SomeType SomeProperty { get; private set; }
public SomeClass(SomeType someProperty) { SomeProperty = someProperty; }
}
我想在构造函数中的参数具有相同的名称属性,但是是小写字母, 。我不想输入名称两次。我该怎么做?
我已经看了XML内容片断,我发现有可以使用的某些功能。例如,内置的“开关”代码段包含以下指令:
<Function>GenerateSwitchCases($expression$)</Function>
据this MSDN documentation page,有三个内置的功能,你可以在这个<Function>
标签使用。不幸的是,他们都没有做我想要的(小写第一个字母)。是否有可能定义一个函数,然后我可以在我的代码片段中使用?
人,我只是试图做几乎同样的事情!哎呀! – 2011-03-29 20:39:22
看到这样的回答: http://stackoverflow.com/questions/5663569/c-custom-code-snippet-functions – ballombert 2011-09-23 22:09:37