如何创建 Visual Studio 2008 菜单选项?
我不确定我所要求的是否符合成熟的加载项的条件,但是这里...
我想在其中一个菜单中添加一个选项(也许是编辑),它可以为我提供有机会清理我的文本——也就是说,有时在业务过程中,我的字符串周围的引号会“倾斜”,而不是垂直向上和向下,这是从外部来源剪切和粘贴的结果。
如果 VS 中有一个“干净的引号”选项,它可以在当前文档中进行搜索和替换,并输入正确的引号,那就太好了。我该怎么做呢,谢谢你的建议。
I'm not sure if what I'm asking for qualifies as a full-fledged add-in, but here goes...
I'd like to put an option in one of the menus (Edit, perhaps) that gives me the opportunity to clean my text-- namely, sometimes in the course of business my quotation marks around strings wind up "slanted" instead of straight up and down, a consequence of cutting and pasting from outside sources.
It would be great to have a "clean quotes" option in VS that does a search and replace in the current document and puts in the correct quotes. How might I go about doing this, and thanks for the advice.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最简单的方法是在“工具”菜单下。单击“工具”->“外部工具...”您可以使用当前目录/文件等的宏来指定您想要的任何程序。您必须找到/创建工具来执行您想要的操作,但添加起来非常简单。您还可以转到“工具”->“自定义...”对话框来添加工具栏按钮或键绑定。
对于您的特定问题,您可以非常简单地编写一个小命令行来为您修复文件,或者使用类似 sed。
The easiest way to do this is under the Tools menu. Click Tools->External Tools... You can specify any program you want using macros for the current directory/file etc. You will have to find/create the tool to do what you want, but it is pretty simple to add. You can also go to the Tools->Customize... dialog to add a toolbar button or key binding.
For your particular problem you could very simply write a little command line to to fixup your file for you or use use something like sed.
你是说你的代码窗口中有不同的字体吗?这不会发生在我身上。我不能让这种事发生在我身上。代码一次只能使用一种字体。
你能提供一个具体的例子吗?
Are you saying you have different fonts in your code window? This doesn't happen to me. I can't make this happen to me. There is only one font for the code at a time.
Can you provide a concrete example?