从继承类自动创建构造函数的Visual Studio快捷方式

时间:2022-07-17 23:03:40

Say I am inheriting from a class with several "overloaded" constructors.

假设我从具有多个“重载”构造函数的类继承。

By any chance is there a short cut in Visual Studio which writes the constructors in the derived class with the same signatures as in the default class for me, with boilerplate code which calls MyBase.New(...) and plugs in the arguments for me?

顺便说一句,Visual Studio中有一个捷径,它在派生类中使用与默认类相同的签名编写构造函数,使用样板代码调用MyBase.New(...)并插入参数我?

EDIT: As far as I can find there is no such shortcut built-in, however there is one in resharper as suggested by Raymond.

编辑:据我所知,内置没有这样的快捷方式,但雷蒙德建议在resharper中有一个。

1 个解决方案

#1


I don't know about a shortcut in a standard Visual Studio installation, but if you install the excellent Resharper plugin from jetBrains, it is Alt-Insert, C. I don't develop without it.

我不知道标准Visual Studio安装中的快捷方式,但是如果你从jetBrains安装了优秀的Resharper插件,它就是Alt-Insert,C。如果没有它,我就不会开发。

#1


I don't know about a shortcut in a standard Visual Studio installation, but if you install the excellent Resharper plugin from jetBrains, it is Alt-Insert, C. I don't develop without it.

我不知道标准Visual Studio安装中的快捷方式,但是如果你从jetBrains安装了优秀的Resharper插件,它就是Alt-Insert,C。如果没有它,我就不会开发。