Hi
I'm wanting some help implementing my grand vision!
I'm reasonably new to template studio but have been through the tutorial and am finding my way around reasonably easily.
I have built a plug-in for the designer which allows me to design business object classes which will then use LLBLGen as the data access layer. The plug-in is working fine, and I'm persisting the designed object model to a XML file in the same folder as the project's LGP file. (In essence, I'm just piggy-backing on LLBLGen to project information for my data access).
What I'm wanting to do now is hook into the code generation process - essentially use LLBLGen to generate my business object classes - and for this, I'll need to gain access to my business object class Object Model (essentially the de-serialised version of my XML file). What I want to do is be able to write templates that I can then call for each object in my business object model (which probably won't/may not correspond directly to my data access classes).
From the experiments I've done so far, the only way I can see of doing this is to subclass the DotNetTemplateEngine class and copy (i.e. steal) the code from the Perform method to allow me to compile the templates and then access my business object model and then iterate through my business objects, calling the compiled LPT template for each one.
This sounds very convoluted, and maybe this is just because I'm trying to bend LLBLGen to fit something it's not intended for - essentially I'm trying to use it as a general purpose Code Generator (and a bloody good one, at that! ).
At the very least, my job would be easier is I could just sub-class the DotNetTemplateEngine class and then have a custom emitType - in fact if the Perform method was refactored out so that the actual "emit" part was in a separate method, I could just override that one method and make it do what I wanted.
Am I crazy? Any thoughts on whether I'm on the right track would be much appreciated and warmly received!
Craig