【发布时间】:2013-06-19 12:21:43
【问题描述】:
在 Visual Studio 2012 中,我创建了一个宏来创建一个左大括号、创建一个新行、创建一个新行、创建右大括号并将光标向上移动一行,然后是一个 TAB。
该宏与 Ctrl + 0 相关联,因此在 Ctrl + 0 之后我准备好了写代码。
如何在没有我的宏的 Visual Studio 2012 中做同样的事情?
【问题讨论】:
-
感谢费边。我快速而肮脏地创建了一个插件。将其放入 Exec(...) TextSelection objSel = (EnvDTE.TextSelection)(_applicationObject.ActiveDocument.Selection); objSel.NewLine(); objSel.Insert("{"); objSel.Indent(); objSel.NewLine(); objSel.NewLine(); objSel.Insert("}"); objSel.Indent(); objSel.LineUp(); objSel.Indent(); objSel.SmartFormat(); objSel.LineUp();
标签: c# visual-studio-2012 macros editor