Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Creating a Custom Editor for new File Type

$
0
0

So,

This should be relatively simple, and to start I'll provide an analogous comparison:

An XSD file is an XML formatted document that contains schema data.  In Visual Studio you can view the XSD format in the XML Editor.  You can also, given the correct circumstances and data in the file, open the XSD in the DataSet visual editor.  The DataSet editor is a separate editor for what is basically a non-code text document.

Now, I have created a custom system that utilizes an XML file that produces code from it, just like the DataSet editor uses an XSD to generate code.  I have already figured out all the parts necessary to create my own custom generator and how to register it so when the editor closes it generates code from the source data.  My current successes involved replacing the default DataSetGenerator to produce my own version from the same XSD file.

I also have worked with TemplateWizards.  So, when I go to "add item to project", I can select my own custom template for this new "DMXML" file, and an editor (windows form) pops up before file creation and allows me to configure it.  However, once it is created in the project, if I double click on the DMXML file, it sends me to the XML Editor.  I want the option to reload that file in the very same form editor I used when creating it.

How do I take my UserContol or Windows Form, and associate it with the specific file extension .dmxml as that extensions editor, just like the DataSet editor is associated with the xsd extension?  I want to double click on my dmxml file and have my editor for that file pop up, the same as the Forms Editor, and the DataSet editor do for their associated files.

I figure I have to register the editor somehow, probably requiring some form of editor class, interface, attributes or some combination therein, which I can "install" into Visual Studio. This is the only part of this process of VS extensibility that I have not been able to figure out, and my questions over the years have not yet yielded helpful results. 

Thanks

Jaeden "Sifo Dyas" al'Raec Ruiner


"Never Trust a computer. Your brain is smarter than any micro-chip."
PS - Don't mark answers on other people's questions. There are such things as Vacations and Holidays which may reduce timely activity, and until the person asking the question can test your answer, it is not correct just because you think it is. Marking it correct for them often stops other people from even reading the question and possibly providing the real "correct" answer.


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>