是否可以为没有扩展名的文件创建ProvideEditorExtensionAttribute [英] Is it possible to create a ProvideEditorExtensionAttribute for files that have no extension

查看:56
本文介绍了是否可以为没有扩展名的文件创建ProvideEditorExtensionAttribute的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个VS 2010 VSIX vsPackage,其中包含一个自定义编辑器,该编辑器非常适合带有扩展名的文件(如FILENAME.MYEXT).但是,我现在需要支持没有扩展名的文件(如FILENAME中一样).

I have a VS 2010 VSIX vsPackage that includes a custom editor which works great for files that have an extension (as in FILENAME.MYEXT).  However, I now need to support files that don't have an extension (as in FILENAME).

使用:

  [ProvideEditorExtensionAttribute(typeof(MyEditorFactory),",255)]

导致编译错误.

使用:

  [ProvideEditorExtensionAttribute(typeof(MyEditorFactory),.",255)]

可以编译,但是我的编辑器永远不会被调用.

compiles, but my editor never gets invoked.

我确实导出了".空白扩展名使用以下内容,但没有帮助.

I did export the "." blank extension using the following but it didn't help.

   [导出]
[FileExtension(."))
[ContentType(MyContentType)]
内部静态FileExtensionToContentTypeDefinition noFileExtensionToContentTypeDefinition = null;

   [Export]
    [FileExtension(".")]
    [ContentType(MyContentType)]
    internal static FileExtensionToContentTypeDefinition noFileExtensionToContentTypeDefinition = null;

如何为我的vsPackage中没有文件名扩展名的文件调用我的自定义编辑器?

How can I invoke my custom editor for files that do not have a filename extension in my vsPackage?

感谢您的帮助,
标记

Thanks for your help,
Mark

推荐答案


这篇关于是否可以为没有扩展名的文件创建ProvideEditorExtensionAttribute的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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