This project has moved and is read-only. For the latest updates, please go here.

How to override component 'ResolveReferenceLinksComponent'?

Topics: Developer Forum
Jul 1, 2014 at 9:18 PM
I would like to override ResolveReferenceLinksComponent so that I can adjust the way in which language specific content is generated by replacing LinkTextResolver with a customized version.

Essentially I want to replace implementations of 'languageSpecificText' with my own encoding by adjusting the implementation of the following methods:
  • WriteTemplateParameters
  • WriteTemplateArguments
  • WriteArrayType
  • WriteSeparator
  • WritePointerType
  • WriteReferenceType
  • WriteTemplateType
  • WriteConversionOperator
  • WriteMethodParameters
  • WriteConversionOperatorParameters
  • WriteProperty
I have already adjusted the templates and this is working nicely with my custom syntax selector. I just need to provide the same behaviour here as well.

Is it possible to override the implementation of a MEF component like this?

This is the last customization I need to make to my SHFB plug-in :D
Jul 1, 2014 at 11:09 PM
You can derive a class from it and override the Initialize and Apply methods as needed or clone it and create an entirely new build component. Either way, you'd create a new MEF factory class with a unique ID that would be used to create it. You'd then reference your new ID in place of the Resolve Reference Links component ID in the BuildAssembler configuration files so that your new component is used in its place.

Jul 1, 2014 at 11:20 PM
This sounds great, where can I find the BuildAssembler configuration files to make this change?

A naive 'Find in Files' doesn't seem to be helping me.

Jul 1, 2014 at 11:56 PM
Ah!! never mind I found it!

I was searching for the class name rather than the id "Resolve Reference Links Component".

/me slaps head

Thanks again for your help :)
Jul 1, 2014 at 11:59 PM
I have made a small donation to thank you for your help with my questions :)
Jul 2, 2014 at 6:14 PM
Thank you. It is much appreciated.