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

查看:25
本文介绍了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 中的宏来提高我的编码速度.偶然发现视觉基础.我不喜欢那样.

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?

感谢您的建议,克里斯

PS:我对录制和播放几乎很满意.但是,事实证明,某些外部" resharper 命令(如全部折叠)不能很好地与宏配合使用(出现奇怪的 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天全站免登陆