1. 程式人生 > >Visual Studio 2008 可擴充套件性開發(六):操作Solution Explorer

Visual Studio 2008 可擴充套件性開發(六):操作Solution Explorer


OnConnection()
{
    
    
// Get "Solution Explorer" command bar    CommandBar slnCommandBar = GetCommandBarByName("Solution");
    
// Add a new command    AddNamedCommand2(slnCommandBar, COLLAPSE_ALL_PROJECTS_COMMAND_NAME,
        
"Collapse All Projects""Collapse All Projects"false0, slnCommandBar.Controls.Count 
+1);
}

QueryStatus()
{
    
    
elseif (commandName == GetCommandFullName(COLLAPSE_ALL_PROJECTS_COMMAND_NAME))
    {
        status 
= (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
        
return;
    }
}

Exec()
{
    
    
elseif (commandName == GetCommandFullName(COLLAPSE_ALL_PROJECTS_COMMAND_NAME))
    {
        CollapseAllProjects();

        handled 
=true;
        
return;
    }
}