如何将项目添加到“打开方式”中从解决方案资源管理器的“打开方式...”打开的对话框上下文菜单。

编程入门 行业动态 更新时间:2024-10-10 01:21:21
本文介绍了如何将项目添加到“打开方式”中从解决方案资源管理器的“打开方式...”打开的对话框上下文菜单。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要将VS Extension中的项目添加到"Open With ..."中。单击解决方案资源管理器的"打开方式..."时出现在VS 2015中的对话框上下文菜单。

Hi, I need to add an item from a VS Extension to the "Open With..." dialog that appears in VS 2015 when you click on the Solution Explorer's "Open With..." context menu.

我看了所有可用的VS接口,但找不到正确的接口。我可以手动添加项目,每件事情都按我想要的方式工作。我只需要能够将其添加到"打开方式"中。我的扩展名列表。

I've looked though all the availible VS interfaces and cannot find the correct one. I can add the item manualy and every thing works the way I want it to. I just need to be able to add it to this "Open With" list in my Extension.

非常感谢

Neal

推荐答案

嗨Neal,

"打开方式"对话框由在Visual Studio IDE中注册的各种编辑器填充。通常,当您为VS构建自定义编辑器时,您将使用 ProvideEditorExtensionAttribute 将文件扩展名与自定义编辑器相关联。此属性(应用于VS Package对象)将在程序包的.pkgdef文件中生成最终合并到注册表中的条目(或VS 2017及更新版本中的privateregistry.bin )。

That Open With dialog is populated by the various editors registered with Visual Studio IDE. Typically, when you build a custom editor for VS, you'll use the ProvideEditorExtensionAttribute to associate a file extension with your custom editor. This attribute (applied to your VS Package object), will generate entries in your package's .pkgdef file, that are ultimately merged into the registry (or the privateregistry.bin in the case of VS 2017 and newer).

与ProvideEditorExtensionAttribute相关联的 NameResourceID属性通常用于注册您在"打开方式"中看到的字符串。对话框。

The NameResourceID property associated with the ProvideEditorExtensionAttribute, is what's typically used to register the string(s) you see in that "Open With" dialog.

如果您在GitHub上搜索 VSSDK-Extensibility-Samples ,你会找到几个例子。

If you search the VSSDK-Extensibility-Samples on GitHub, you'll find a couple of examples.

此致,

更多推荐

如何将项目添加到“打开方式”中从解决方案资源管理器的“打开方式...”打开的对话框上下文菜单。

本文发布于:2023-11-13 06:19:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1583677.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:方式   上下文   对话框   资源管理器   如何将

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!