Ybsoftwarefactory is a software developed using. net.CodeThe intelligent and quick generation platform allows you to easily and quickly generate anyProgramming Language, Any type of applicationProgramCode. The latest version 2.0 supports plug-in development. You can perform secondary development based on your needs to generate any code that fully meets your needs. This series describes how to use ybsoftwarefactory 2.0 to develop a set of code generation plug-ins that fully meet your needs.
A code generation plug-in of ybsoftwarefactory mainly consists of compressed files, template files, and classes that implement corresponding interfaces. The project directory structure of a typical code generation plug-in is as follows:
1. compressed files
Compress files to store public components, classes, resources, and images that do not require code generation in a solution. These files can be decompressed before the code is generated. The main function is to compile and execute the code immediately after it is generated. If you do not have such requirements, you cannot provide them.
Ii. template files
The template code written using the T4 template syntax is the core of code generation. If you are not familiar with the T4 syntax, go. The template file can be edited later by using the template management function in ybsoftwarefactory.
Iii. Implementation of the following classes
1) implement a class inherited from "iplugingrouprepository", which is used to load each sub-plug-in this group. The plug-in group will appear in the navigation bar on the left of ybsoftwarefactory.
2) At least one or more implementations inherited from "pluginrepositorybase
Class, which is used to generateSource codeEach plug-in can generate a separate set of source code. The generated code supports two modes: "file direct output" and "code preview. For example, you can separate the solution, entity layer, and interface layer code into a plug-in for later development. Then, the plug-in group will automatically load all its subordinate plug-ins.
As shown in, after clicking a plug-in group in the navigation bar, all the plug-ins in the plug-in group are dynamically displayed in the rabbion control.
3) Finally, you can provide corresponding image resources as needed, so that you can display personalized icons on each plug-in group and plug-in (as shown in ).
This is simple. After the plug-in is developed, copy the relevant files to the plugin sub-folder under the application folder. After the program is started, the corresponding navigation bar and ribbon toolbar are automatically loaded.
The next section describes the implementation demo of each class in the custom plug-in project.