VS plug-in development, vs plug-in
I have been busy with some things recently and haven't published any articles.
In the past few days, I 've been reading something about VS plug-in development. I wrote a small program with no technical content, but it's a bit interesting. Haha.
When VS is enabled, a prompt box similar to logon will pop up, prompting you to enter the account and password:
If the input is incorrect, a prompt is displayed and you can exit VS directly:
If the input is correct, the system prompts the welcome message to go to:
Because the code of this function is mixed with other projects, I will not issue the complete code. Let's talk about the design steps, which is very simple.
The procedure is as follows:
Open VS, create a project, and find "VS Package" in "other project types" on the left ".
If not, download the SDK of the corresponding version of Visual Studio and install it, that is, more than one hundred MB. Self-Test VS2012 comes with it. VS2013 needs to be downloaded separately.
This project is the production project of the visx plug-in of VS. After writing it, you can generate a visx plug-in and double-click it to install it to the project in.
Then, after creating a new project, find the "Project name Package. cs" file in the project. This file is the file for the plug-in to start and run each time, which is equivalent to the Startup File.
Therefore, open this file and there will be a constructor, where you can write the login code or Load.
Create a login interface form. Here I create a WPF form and drag and drop the desired interface, for example, my:
Then you don't need to write the logon code.
Finally, return to the "Project name Package. cs" Startup File and add the code for starting the logon interface in the constructor or Load method.
Here, I wrote in Load:
Protected override void Initialize () {base. initialize (); // In the initialization method, add the Method Application for the current program Load event. current. mainWindow. loaded + = MainWindow_Loaded;} // method of the Load event void MainWindow_Loaded (object sender, RoutedEventArgs e) {// instantiate and open the login interface startup form login = new startup form (); login. showDialog ();}
After a project is generated, a "project name. visx" plug-in will be generated in the project bin \ debug. Close the VS plug-in, double-click the plug-in to install it, and then re-open the VS. Let's see the effect.
The plug-in is automatically installed in "tools-extensions and updates.
If an error occurs, it indicates that vsis disabled. Run the command "restart devenv.exe/safemode" to open VS security mode, and go to "tools-extensions and updates" to uninstall the plug-in you just created.
If you still don't understand anything, leave a message.
Although I haven't sent much code, it's not easy to type it, just give it a thumbs up.
[From: [LonelyShadow blog] http://www.cnblogs.com/lonelyshadow]
VS plug-in development can use C ++?
Can be changed to VC ++
Many of our company's VS2005/2008 plug-ins are developed using VC ++ 8.0/9.0
Develop your own plug-in vs2010
Haha, points