VsCommands2K.EXPAND_CHILDREN的用法 [英] Usage of VsCommands2K.EXPAND_CHILDREN

查看:63
本文介绍了VsCommands2K.EXPAND_CHILDREN的用法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在QueryStatusOnNode&在解决方案资源管理器中展开任何项目时,将使用ExecCommandOnNode

I am expecting a call back at QueryStatusOnNode & ExecCommandOnNode when any item is expanded in the Solution Explorer 

以下是我在FolderNode中拥有的代码,当我从解决方案资源管理器中展开文件夹时,我希望查询其中的Expand命令之一.

Following is the code I have in my FolderNode, When I expand a folder from the solution explorer, I expect one of these Expand command be queried for..but i am not getting the call back

protected override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result)
{
  if(cmdGroup == VsMenus.guidStandardCommandSet97)
  {
      case VsCommands.Expand:
      case VsCommands.ExpandAll:
      case VsCommands.ExpandImages:
      case VsCommands.ExpandLinks:
      case VsCommands.ExpandPages:
	result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
	return VSConstants.S_OK;
   }
   else if(cmdGroup == VsMenus.guidStandardCommandSet2K)      
   {
      if ((VsCommands2K)cmd == VsCommands2K.EXPANDSELECTION || (VsCommands2K)cmd == VsCommands2K.EXPANDCONTROLS || (VsCommands2K)cmd == VsCommands2K.EXPAND_CHILDREN )
      {
        result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
        return VSConstants.S_OK;
      }
   }
}


任何对此的帮助将不胜感激

Any help on this would be appreciated

预先感谢

推荐答案

迪娜,

当您从解决方案资源管理器中展开文件夹时,可以调用此方法吗?

When you expand a folder from the solution explorer, can this method be called?

此QueryStatusOnNode方法为以下命令提供支持: 复制 粘贴 剪切 重命名 ViewCode 打开 OpenWith 和. EXCLUDEFROMPROJECT .

This method of QueryStatusOnNode provides support for the following commands: Copy, Paste, Cut, Rename, ViewCode, Open, OpenWith, and.EXCLUDEFROMPROJECT.

我不认为它支持Expand命令.

I don't think it supports the Expand command.

您可以参考更多信息:

http://msdn.microsoft. com/en-us/library/microsoft.visualstudio.package.filenode.querystatusonnode(VS.90).aspx

最好的问候


这篇关于VsCommands2K.EXPAND_CHILDREN的用法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆