Question

XNA Game Studio somehow extended the properties window in Visual Studio with two new combo boxes, "Importer" and "Processor". These combo boxes contained the available importers and processors defined in code in the current solution, and when these fields were changed, the setting was saved to the corresponding item's metadata in the project file.

I'm curious about how they achieved this? Any information would be appreciated.

enter image description here

Was it helpful?

Solution

There is a old but good article explaining the principles behind how it's done. Basically it comes down to implementing the IExtenderProvider interface and determine which objects it should extend via the CanExtendMethod, using the CATID of the object to identify it. For the object to be extended you return an extender using the GetExtender method. Note that the extender must be marked as ComVisible.

The extender provider is registered either statically in the registry or dynamically using code. The documentation is very thin, but this page says that the extenders are able to add properties and also hide or alter existing properties.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top