I have never been a break, this DCG finally launched the super functional version "1.3.4.0", and the new super function makes DCG more complete. ^ _ ^
The specific changes are as follows:
OCD (Object Construction Document), an object construct file, can generate an object in the program by incoming an OCD, with a dynamic template to obtain different output results without changing the source code. OCD is mainly used to provide parameters for dynamic templates. Nested template, simple and convenient to call other dynamic templates in the dynamic template, which is the nested template. In a new version, DCG adds a built-in class DCG, and the method of calling the nested template is defined in the DCG this built-in class. DCG built-in classes, this built-in class has some static properties and methods available for template calls, and members in this built-in class are some objects that are closely related to the template itself, such as the DCG.FileInfo property contains the path including the template itself. Template call. Bug FIX fixes the bugs about the assembly references.
In addition to the functional enhancements of DCG itself, I also wrote a DCGCONSOLE, a command line tool specifically used to use dynamic templates and OCD output, which can support batch processing by incoming XML configuration files, and can also be used In your own batch file, you have a detailed description (or record) of the error message of the template.
The above is all DCG changes, and some extensions I have to do are as follows:
A Windows Application (DCGWIN) supports the same features as DCGConsole, which is usually used in general than DCGConsole. The writing of the dynamic template is still more difficult, so make a dynamic template editor, supports checking compile time errors, and considering joining debugging.
While launching DCG V1.3.4.0, I also wrote a relatively complex DCG application example, I hope to use this to show extraordinary features of DCG and help you quickly understand and master DCG. The actual scenario is as follows, in the process of making DCGConsole, you need to read an XML format profile to use to batch template, then DCGConsole needs to have XML functionality, which can be done in .NET. When this processing is not intuitive, it is difficult to read the code for processing, it is not convenient to maintain. So can you make a strong format of the XML file, just like a strong DataSet? The answer is of course affirmation, I just do this. Strong types are completely required for code generators. The tool can be done well. If it is not handwritten, it will be exhausted. Here is the place where DCG is involved. I use DCGConsole itself with DCG to generate XML files that I define the format, then Import into DCGConsole to accept XML batch file ^ _ ^ is very simple, just pass the path to the template an XML file, it can help you generate a set of strong types of Types of this XML structure, detailed code I will give it in the next blog.
Ok, this time DCG introduces here, I will slowly organize a document for your reference.