0

I am creating a ReSharper template and need to add a macro that sets a value which can only be selected from an enum. Is it possible to do this in ReSharper? I have a command named $AUTHOR$ and I need it to resolve to EnumAuthors.?? Where ?? is where I pick teh enum value I want.

Thanks!

4

1 回答 1

0

You can use the "Execute smart completion" or "Execute basic completion" macros to provide code completion for the values of an enum. For example:

public void Foo()
{
  var author = EnumAuthors.$VALUE$;
}

when you come to expand $VALUE$, code completion will display just the values of EnumAuthors.

于 2014-05-21T08:21:11.117 回答