Visual Studio's code snippet: how to add logic in it?
c#, visual-studio-2010
Solution
Unfortunately this type of logic is not available in the Visual Studio snippets functionality. Having to type out both names is the best you can do.
Here are the only "functions" available to you when creating a code snippet. MSDN Code Snippet Functions
Products like Resharper provide excellent code snippet (called Templates in Resharper) functionality, with the ability to change the casing of other replacements within the snippet, among many other useful functions. Resharper Template Info
For example, you would be interested in this macro:
"Value of another variable with the first character in lower case"
Problem
I've made a small code snippet to create a property for WPF data bingings: ``` private string property; public string Property { get { return this.property; } set { this.property = value; this.OnPropertyChanged(() => Property); } } ``` It is pretty cumbersome to create the field name in Camel Case and rewrite the property in Pascal Case. Is there a way to only write the field and let the snippet writes the property using the name of the field with the first character in upper case?