Objective
To be honest, the previous essays would be tedious to read, and more so. But the fun is always behind me, and from this I'll show you how it's much more interesting to manipulate the elements of VS in add-in.
Most of the time, we develop in VS, starting with the solution open, then finding the project, opening the file for development. This article describes the content associated with this.
Introduction to Solutions, projects, and items
I believe that these three are to us. NET developers are more familiar. But their representation in AOM (the Automation object model) is not the same as we would have imagined. Look at figure 1 below, where the main elements are solutions, solution Folders, projects, folders, files. AOM represents the solution through the solution interface; The project interface represents the solution folder and project, and the ProjectItem interface represents the folders and files. I'll introduce them with an example below.
Simple Code Generators
In the actual development, we often need to adopt some specific technical solutions, which determine the overall structure of the program, manifested in the program is a number of projects, assemblies, configuration files of the organization. There was a time when you liked Ibatis.net, and here's a demo of its example project Npetshop. The basic structure of the npetshop is as follows:
Diagram 1:npetshop Program Structure
Its code can be found in the Npetshop source for. NET 2.0 article. External-bin inside is the required various assemblies, domain is the entity class, persistence is the data access layer, service is the business logic layer, presentation is the performance logic layer, the Web is responsible for the final performance. If you were to develop this solution, it would take us some time to build the framework for the entire solution at the beginning of the project. Through add-in, we can do "one time to write, multiple use."
Now let's look at how to create a solution from scratch. In this case, the approximate process is:
Figure 2: Solution creation Process