欢迎光临
我们一直在努力

Visual Studio 2008 可扩展性开发(六):操作Solution Explorer



C# Code – 添加CollapseAllProjects命令

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

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

Exec()
{
    
    else if (commandName == GetCommandFullName(COLLAPSE_ALL_PROJECTS_COMMAND_NAME))
    {
        CollapseAllProjects();

        handled = true;
        
return;
    }
}

未经允许不得转载:大有博文 » Visual Studio 2008 可扩展性开发(六):操作Solution Explorer
分享到: 更多 (0)

大前端WP主题 更专业 更方便

联系我们联系我们