.net – 如何在几秒钟内使用ReSharper创建方法参数对象?

是否可以选择方法的所有参数并要求ReSharper从这些参数创建一个类作为“方法参数对象?”
ReSharper支持命令Extract Class From Parameters

The Extract Class From Parameters
refactoring allows you to quickly
create a new class or structure using
(some of) the parameters of a given
method. ReSharper analyses the
selected method and detects the
variables that can be converted into
members. After extraction, the new
class is created with the necessary
fields generated from the selected
method’s parameters.

要调用它:

>将光标放在方法上
要为其生成类的参数
>按Ctrl Shift R.
>选择’从类提取类
参数
>在对话框中执行任何其他配置.

翻译自:https://stackoverflow.com/questions/4067960/how-to-create-a-method-parameter-object-with-resharper-in-a-few-seconds

转载注明原文:.net – 如何在几秒钟内使用ReSharper创建方法参数对象?