如何在vs2005中创建自定义编辑器? [英] How to create custom editor in vs2005?

查看:91
本文介绍了如何在vs2005中创建自定义编辑器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我可以为VS2005开发自己的编辑器吗?

要完成的任务.
对于XML文件,当用户右键单击并选择打开方式时,
我的编辑器名称应出现在列表中,文件(XML)应该以gridview或treeview格式可见.

可能吗 ?

Hello all,

Can I develop my own editor for VS2005?

Task to achieve.
With XML files, when user right click and select open with,
My editor name should appear in list and file (XML) should be visible in gridview or treeview format.

Is it possible ? How ?

推荐答案

确定.您可以选择任何程序作为给定文件类型的默认编辑器.只需右键单击该文件,然后应该有一些选项,例如打开方式"或编辑方式",Visual Studio将显示一个对话框,其中包含当前与之关联的程序.然后,您可以浏览新程序,然后将其设置为默认程序.尽管我不确定使编辑器内联(例如,像现有的XML编辑器一样,实际上是Visual Studio中的一个窗口)会涉及到哪种工作.
Sure. You can select any program as the default editor for a given file type. Just right click on the file and there should be some option like "Open With" or "Edit With" and Visual Studio will show a dialog with the programs it''s currently associated with. You can then browse for a new program and then set that as the default. Although I''m not sure what kind of work would be involved in making the editor inline (i.e., one of the windows actually inside Visual Studio, like the existing XML editor).


是真的,但该怎么做?
M尝试使用vs2008中的VSPackage开发它.
但是找不到确切的路径吗?怎么做?
Coz VSPackage提供了仅包含textarea的Custom编辑器,我想在treeView或GridView中输出?那么如何编码呢?​​
That true but how to do it ?
M trying to develop it with VSPackage from vs2008.
But not finding exact path ? How to do it ?
Coz VSPackage provide Custom editor which contain only textarea n I want output in treeView or GridView ? So how to code it ?


那么您想创建自己的编辑器吗?轻松创建一个Windows Forms或WPF应用程序,它可以获取文件并根据需要显示它.通过Visual Studio打开文件路径时,该文件路径将作为命令行参数发送.在该路径下打开文件,进行分析,然后在Windows窗体或WPF应用程序中显示所需的文件.
So you want to make your own editor? Easy, create a Windows Forms or WPF application that can take a file and display it however you want. The file path will be sent as a command line argument when you open it via Visual Studio. Open the file at that path, parse it, then display it how you want in your Windows Form or WPF application.


这篇关于如何在vs2005中创建自定义编辑器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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