Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Variable Substitution in Code Templates

$
0
0

Is there a way to create a code template that allows one to specify a variable such as $property_name$, and then allows one to alter the case of that variable in different locations of the template.

For instance, my habit when creating fully-defined properties is to use the following convention:

private string _firstName;
public string FirstName { get {...}; set {...}}

Please note that the member variable utilizes the property name, but has both an underscore and utilizes camel case.

As far as I can determine, defining a code template to handle this scenario requires the definition of two variables, such as:

private string _$membername$;
public string $propname$ { get {...}; set {...}}

What I really want is the ability to do is:

  • Specify one variable ($propname$).
  • Use $propname$ as part of the member name, but transform the first letter to lower case.

Does Xamarin Studio allow for this?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>