In some legacy code, there are hundreds of occurrences of the following code snippets:
myObj.ReportGenerator.Preview = reportingObj.PreviewDocument;
... whereas both the "ReportGenerator" and the "ReportingObj" are instances of a third party library and therefore not modifyable.
This code did work well under Windows XP, but running the program in Windows 7 does require the following additional line of code:
reportingObj.Render();
myObj.ReportGenerator.Preview = reportingObj.PreviewDocument;
Unfortunately, there are hundreds of occurences of this piece of code all of the code base, and manually searching for them sounds like quite error-prone a process.
As "ReportGenerator" and "reportingObj" are third party, I cannot change their getter / setter.
What are elegant ways of approaching such an issue?