用C#在Visual Studio中编写宏? [英] C# for writing macros in Visual Studio?

查看:167
本文介绍了用C#在Visual Studio中编写宏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我前一段时间开始C#,真的很喜欢.

I started C# a while ago and really like it.

我使用VS 2008并非常喜欢它.

I work with VS 2008 and really like it.

我尝试过Resharper并喜欢它.

I tried Resharper and loved it.

现在,我从VS2008中的Macros开始,以进一步提高编码速度.并偶然发现了 Visual Basic .我不喜欢.

Now I am starting with Macros in VS2008 to increase my coding speed a little more. And stumble upon visual basic. And I do not like that.

有什么方法可以用C#编写宏.或一种解决方法,就是为VS编写一个插件以达到相同的目标.让我强调一下,这是一个生产力问题.我只想自动化一些我经常使用的功能(创建宏,分配快捷方式,告诉我的触摸屏应用程序发送此快捷方式)...

Is there any way to write macros in C#. Or a workaround, in writing a plugin for VS to reach the same goal. Just let me stress out, its a productivity issue. I just want to automate some features I use often (create macro, assign shortcut, tell my touchscreen-app to send this shortcut)...

因此,从专家的角度来看,有没有一种简单的方法可以不折叠解决方案资源管理器中的所有项目,但以字母A开头的所有项目"(只是一个愚蠢的示例),而无需使用Visual Basic?

So from an experts point of view, is there an easy way to e.g. "collapse all items in the solution explorer, but expand all starting with the letter A" (just a silly example) without using visual basic?

感谢您的提示, 克里斯

Thanks for any tips, Chris

PS:我对录制和播放几乎满意.但是,事实证明,某些外部"重新共享命令(如全部折叠)在宏中无法很好地发挥作用(出现奇怪的com错误).所以我想,嘿,一个折叠所有物品的循环,我可以做到.但不幸的是,在VB中并不是真的很快:-)

PS: I was nearly happy with recording and playback. But, as it turns out, some "external" resharper command (like collapse all) do not play well with macros (getting strange com errors). So I thought, hey, a loop to collapse all items, I can do that. But unfortunately not really quick in VB :-)

推荐答案

尝试用C#编写DLL并在VB宏中引用它.

Try writing a DLL in C# and referencing it in a VB macro.

这样,您唯一需要编写的VB是将DLL连接到IDE的代码.

This way, the only VB you'll need to write is the code to connect the DLL to the IDE.

这篇关于用C#在Visual Studio中编写宏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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