Above is the rendering
Visual Studio.NET plugins can do many things, such as: 1. Write code assistance tools for development environments like CodeRush 2. Write code template tools such as CodeSmith 3. Write a code generator to automatically generate code according to some customized conditions. For example, some of the more popular code generation tools should be more convenient to use if integrated with the development environment. 4. Write a debugging tool such as DataSetPryer, you can view the contents of DataSet during debugging. 5. You can even integrate Google search engine in VS.net, or integrate MSN into VS.Net. I won't list them all here, but in short, everything that can be related to the Visual Studio.NET development environment can be done in the form of plugins. There are currently two forms of developing VS.NET plug-ins: one is VS plug-ins generated by VS Wizard; The second is to use Microsoft's VSIP development package (Visual Studio Industry Partner: Microsoft Partner Program). This article discusses the first method.
2. Overview of the procedural framework Select "New Project × Other Project × Extension Project à Visual Studio.NET Add-on" in the Visual Studio.NET, follow the wizard to generate code, and finally generate two project files, one is the add-in project and the other is the add-in installation project. You can see a connect.cs file in the generated project file in the add-in project, which has the following parts:
1. Inheritance interface of class and its constant definition
public class Connect : Object, Extensibility.IDTExtensibility2, IDTCommandTarget {…} The Connect class mainly inherits from two interfaces, one is the Extensibility.IDTExtensibility2 interface, which mainly defines the following methods: OnAddInsUpdate method: Occurs when an add-in is loaded or uninstalled in the environment. OnBeginShutdown method: Occurs when the environment is being shut down. OnConnection method: Occurs when an add-in is loaded into the environment. OnDisconnection method: Occurs when an add-in is uninstalled from the environment. OnStartupComplete method: Occurs when the environment finishes starting.
The IDTCommandTarget interface defines the following two methods Exec method: Called by the VS environment when an external menu command is selected in the VS development environment. QueryStatus method: Calls this method to query the status of the menu when the VS environment wants to display an external menu. The method returns the current state of the specified named command, whether it is enabled, disabled, or hidden
The code is as follows:
Finished product download:
Tourists, if you want to see the hidden content of this post, please Reply
Source code download:
Tourists, if you want to see the hidden content of this post, please Reply
How do I use plugins???
|