格式化C#code段的文字参数 [英] Formatting Literal parameters of a C# code snippet
问题描述
有什么办法,我可以改变一个如何面值的code片段的渲染,当它在code。该片段生成使用?
Is there any way that I can change how a Literal of a code snippet renders when it is used in the code that the snippet generates?
我特别想知道如果我能有一个文字叫说,$属性名$,然后拿到片段引擎渲染_ $属性名$其中第一个字符被换成小写。
Specifically I'd like to know if I can have a literal called say, $PropertyName$ and then get the snippet engine to render "_$PropertyName$ where the first character is made lowercase.
我买不起R·。请帮助:)
I can't afford R#. Please help :)
推荐答案
不幸的是似乎没有办法。片段提供令人惊讶的有限支持转换功能的你可以看到。
Unfortunately there seems to be no way. Snippets offer amazingly limited support for transformation functions as you can see.
您必须坚持使用VS标准的解决方案,这是写两个字符串:一个是属性名称,以及其他为成员变量名称
You have to stick with the VS standard solution, which is to write two literals: one for the property name, and the other for the member variable name.
这篇关于格式化C#code段的文字参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!