VisualStudio中是否有创建方法的快捷方式? [英] Is there a shortcut in VisualStudio to create a method?

查看:241
本文介绍了VisualStudio中是否有创建方法的快捷方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VisualStudio中是否存在创建方法的快捷方式,例如,属性的属性为"prop,tab",构造函数的属性为"ctor,tab"?

Is there a shortcut in VisualStudio to create a method, like there is "prop, tab" for a property and "ctor, tab" for a constructor?

推荐答案

没有代码段 t创建除Main之外的方法,但是您可以执行以下操作.

There is no Code snippet to create a method other than Main, but you can do the following.

键入您的要成为的方法名称,并传递参数.完成后,您会在方法名称的开头看到一个蓝色的下划线.单击该(或单击 Ctrl + .),这将为您提供创建方法的选项,例如:

Type your to be method name, pass the parameters, Once done you will notice a blue under line at the beginning of method name. Click that (or click Ctrl + . ) that will give you the option to create method like:

这将生成如下方法:

private static void MySomeMethod(int a, string b)
{
    throw new NotImplementedException();
}

这篇关于VisualStudio中是否有创建方法的快捷方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆