Code snippet or shortcut to create a constructor in Visual Studio

前端 未结 17 1709
悲哀的现实
悲哀的现实 2020-12-23 12:57

What is the code snippet or shortcut for creating a constructor in Visual Studio?

Visual Studio 2010 and C#.

17条回答
  •  忘掉有多难
    2020-12-23 13:22

    I have created some handy code snippets that'll create overloaded constructors as well. You're welcome to use them: https://github.com/ejbeaty/Power-Snippets

    For example: 'ctor2' would create a constructor with two arguments and allow you to tab through them one by one like this:

    public MyClass(ArgType argName, ArgType argName)
    {
    
    }
    

提交回复
热议问题