1. 程式人生 > >自動生成解決方案和專案並生成專案

自動生成解決方案和專案並生成專案

{
                
object []contextGUIDS =newobject[] { };
                Commands commands 
= applicationObject.Commands;
                _CommandBars commandBars 
= applicationObject.CommandBars;

                
// When run, the Add-in wizard prepared the registry for the Add-in.
                
// At a later time, the Add-in or its commands may become unavailable for reasons such as:
                
//   1) You moved this project to a computer other than which is was originally created on.
                
//   2) You chose 'Yes' when presented with a message asking if you wish to remove the Add-in.
                
//   3) You add new commands or modify commands already defined.
                
// You will need to re-register the Add-in by building the CodeToolAddinSetup project,
                
// right-clicking the project in the Solution Explorer, and then choosing install.
                
// Alternatively, you could execute the ReCreateCommands.reg file the Add-in Wizard generated in
                
// the project directory, or run 'devenv /setup' from a command prompt.
try
                
{
                    Command command 
= commands.AddNamedCommand(addInInstance, "CodeToolAddin""CodeToolAddin""Executes the command for CodeToolAddin"true59ref contextGUIDS, (int)vsCommandStatus.vsCommandStatusSupported+(int)vsCommandStatus.vsCommandStatusEnabled);
                    CommandBar commandBar 
= (CommandBar)commandBars["Tools"];
                    CommandBarControl commandBarControl 
= command.AddControl(commandBar, 1);
                }

                
catch(System.Exception /*e*/)
                
{
                }

            }