I am writing a visual studio extension which would be used to edit parts of an xml file. I want to intercept the file load, and only load the relevant parts into the editor. I am trying to use the ITextDocumentFactoryService interface.
[Export]
public sealed class TextDocumentFactory
: ITextDocumentFactoryService
{I create and register my service during package initialisation :
TextDocumentFactory textDocumentFactory =
new TextDocumentFactory();
((IServiceContainer)this).AddService(
typeof(TextDocumentFactory),
textDocumentFactory,
true);My editor factory creates an editor instance and the DocumentManager opens the editor
result = uiShellOpenDocument.OpenStandardEditor(
This then loads my file into the editor. However nothing calls my service. How do I tell VS when to use my service? Is there an easier way to intercept the file loading?
Jeff