问题
I'm in love with the function in Eclipse "assign to field". Basically, when I have
getString();
and I type Ctrl + 2, Eclipse converts this into
String getString = getString();
Is this possible in VS 2010?
回答1:
I believe the thing you're looking for is a refactoring typically called "introduce variable". As far as I know, Visual Studio doesn't support this. However ReSharper and other tools like it do.
回答2:
I have not worked in eclipse for years so I am not familiar with the example, but have you tried code snippets in VS?
There is a tool for customizing them that you can get from here.
回答3:
If you are using Resharper Shortcut is Ctrl+R,V
来源:https://stackoverflow.com/questions/2793581/visual-studio-2010-assign-to-local-variable-function