visual-studio - 创建区域方法的键盘快捷键

标签 visual-studio keyboard-shortcuts

我可以在 Visual Studio 中创建区域化方法的键盘快捷方式并使用 GhostDoc 自动记录它吗?

由此:

protected override void OnInit(EventArgs e)
{
   base.OnInit(e);
} 

我想做这个:

#region protected override void OnInit(EventArgs e)
/// <summary>
/// Raises the <see cref="E:Init"/> event.
/// </summary>
/// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
protected override void OnInit(EventArgs e)
{           
   base.OnInit(e);
} 
#endregion

最佳答案

我不确定 GhostDoc 自动文档,但要对所选文本进行区域划分,您可以使用 Visual Studio 中的“环绕”功能。

选择一部分代码并按 Ctrl + K、S。这会调出“环绕”上下文菜单。在菜单中选择“地区”,输入您的地区名称,一切就绪。

这个函数也可以用于一堆其他的东西。 if、for、while 和 try 语句等等。

关于visual-studio - 创建区域方法的键盘快捷键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1378606/

相关文章:

Xcode:用于在提交 View 中导航更改的键盘快捷键?

c++ - 如何在 Windows 上安装 TensorFlow?

c# - 编译Windows Form应用程序时出现错误MSB3095

.net - 什么是 ResolveAssemblyReference.cache?

keyboard-shortcuts - 将 jupyter 笔记本快捷方式重置为默认值

eclipse - 自定义eclipse任务栏

visual-studio-2010 - 如何设置我的 git 存储库以便能够轻松地在 Visual Studio 中重用项目

c++ - 学习完毕,有什么建议吗?

vim - 如何更改 Vim 中的快捷键?

python - 尽管重新启动,F2 键在 Eclipse Pydev 中不起作用