本文整理汇总了C#中QueryStatusResult类的典型用法代码示例。如果您正苦于以下问题:C# QueryStatusResult类的具体用法?C# QueryStatusResult怎么用?C# QueryStatusResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QueryStatusResult类属于命名空间,在下文中一共展示了QueryStatusResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QueryStatusOnNode
internal override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result) {
//Hide Exclude from Project command, show everything else normal Folder node supports
if (cmdGroup == Microsoft.VisualStudioTools.Project.VsMenus.guidStandardCommandSet2K) {
switch ((VsCommands2K)cmd) {
case VsCommands2K.EXCLUDEFROMPROJECT:
if (ItemNode.IsExcluded) {
result |= QueryStatusResult.NOTSUPPORTED | QueryStatusResult.INVISIBLE;
return VSConstants.S_OK;
}
break;
case VsCommands2K.INCLUDEINPROJECT:
if (ItemNode.IsExcluded) {
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
return VSConstants.S_OK;
}
break;
case CommonConstants.OpenFolderInExplorerCmdId:
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
return VSConstants.S_OK;
}
} else if (cmdGroup == ProjectMgr.SharedCommandGuid) {
switch ((SharedCommands)cmd) {
case SharedCommands.AddExistingFolder:
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
return VSConstants.S_OK;
}
}
return base.QueryStatusOnNode(cmdGroup, cmd, pCmdText, ref result);
}
示例2: QueryStatusOnNode
internal override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result)
{
if (IsEntryPoint)
{
if (cmdGroup == Microsoft.VisualStudioTools.Project.VsMenus.guidStandardCommandSet97
&& (VsCommands)cmd == VsCommands.Rename
|| (VsCommands)cmd == VsCommands.Cut)
{
result |= QueryStatusResult.NOTSUPPORTED;
return (int)OleConstants.OLECMDERR_E_NOTSUPPORTED;
}
if (cmdGroup == Microsoft.VisualStudioTools.Project.VsMenus.guidStandardCommandSet2K
&& (VsCommands2K)cmd == VsCommands2K.EXCLUDEFROMPROJECT)
{
result |= QueryStatusResult.NOTSUPPORTED;
return (int)OleConstants.OLECMDERR_E_NOTSUPPORTED;
}
}
if (cmdGroup == Microsoft.VisualStudioTools.Project.VsMenus.guidStandardCommandSet2K
&& (VsCommands2K)cmd == VsCommands2K.INCLUDEINPROJECT
&& ItemNode.ItemTypeName == null)
{
result |= QueryStatusResult.NOTSUPPORTED;
return (int)OleConstants.OLECMDERR_E_NOTSUPPORTED;
}
return base.QueryStatusOnNode(cmdGroup, cmd, pCmdText, ref result);
}
示例3: QueryStatusOnNode
/// <summary>
/// Disable certain commands for dependent file nodes
/// </summary>
internal override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result)
{
if(cmdGroup == VsMenus.guidStandardCommandSet97)
{
switch((VsCommands)cmd)
{
case VsCommands.Copy:
case VsCommands.Paste:
case VsCommands.Cut:
case VsCommands.Rename:
result |= QueryStatusResult.NOTSUPPORTED;
return VSConstants.S_OK;
case VsCommands.ViewCode:
case VsCommands.Open:
case VsCommands.OpenWith:
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
return VSConstants.S_OK;
}
}
else if(cmdGroup == VsMenus.guidStandardCommandSet2K)
{
if((VsCommands2K)cmd == VsCommands2K.EXCLUDEFROMPROJECT)
{
result |= QueryStatusResult.NOTSUPPORTED;
return VSConstants.S_OK;
}
}
else
{
return (int)OleConstants.OLECMDERR_E_UNKNOWNGROUP;
}
return base.QueryStatusOnNode(cmdGroup, cmd, pCmdText, ref result);
}
示例4: QueryStatusOnNode
internal override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result) {
if (cmdGroup == Guids.NodejsNpmCmdSet) {
switch (cmd) {
case PkgCmdId.cmdidNpmUpdateModules:
if (_parent.IsCurrentStateASuppressCommandsMode()) {
result = QueryStatusResult.SUPPORTED;
}
else {
if (AllChildren.Any()) {
result = QueryStatusResult.ENABLED | QueryStatusResult.SUPPORTED;
}
else {
result = QueryStatusResult.SUPPORTED;
}
}
return VSConstants.S_OK;
case PkgCmdId.cmdidNpmInstallModules:
case PkgCmdId.cmdidNpmInstallSingleMissingModule:
case PkgCmdId.cmdidNpmUninstallModule:
case PkgCmdId.cmdidNpmUpdateSingleModule:
case PkgCmdId.cmdidNpmOpenModuleHomepage:
result = QueryStatusResult.SUPPORTED | QueryStatusResult.INVISIBLE;
return VSConstants.S_OK;
}
}
return base.QueryStatusOnNode(cmdGroup, cmd, pCmdText, ref result);
}
示例5: QueryStatusOnNode
protected override int QueryStatusOnNode(Guid guidCmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result)
{
if (guidCmdGroup == Microsoft.VisualStudio.Shell.VsMenus.guidStandardCommandSet97)
{
switch ((VsCommands)cmd)
{
case VsCommands.AddNewItem:
case VsCommands.AddExistingItem:
case VsCommands.ViewCode:
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
return VSConstants.S_OK;
case VsCommands.ViewForm:
if (SubType == "Form")
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
return VSConstants.S_OK;
}
}
else if (guidCmdGroup == RubyMenus.guidRubyProjectCmdSet && cmd == RubyMenus.SetAsMain.ID)
{
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
return VSConstants.S_OK;
}
return base.QueryStatusOnNode(guidCmdGroup, cmd, pCmdText, ref result);
}
示例6: QueryStatusOnNode
internal override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result)
{
if (cmdGroup == Microsoft.VisualStudioTools.Project.VsMenus.guidStandardCommandSet2K
&& (VsCommands2K)cmd == VsCommands2K.INCLUDEINPROJECT)
{
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
return (int)VSConstants.S_OK;
}
return base.QueryStatusOnNode(cmdGroup, cmd, pCmdText, ref result);
}
示例7: QueryStatusOnNode
/// <inheritdoc />
protected override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText,
ref QueryStatusResult result)
{
if(cmdGroup == GuidList.guidSandcastleBuilderPackageCmdSet && cmd == PkgCmdIDList.AddDocSource)
{
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.INVISIBLE;
return VSConstants.S_OK;
}
return base.QueryStatusOnNode(cmdGroup, cmd, pCmdText, ref result);
}
示例8: QueryStatusOnNode
protected override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result)
{
//Hide Exclude from Project command, show everything else normal Folder node supports
if (cmdGroup == Microsoft.VisualStudio.Project.VsMenus.guidStandardCommandSet2K) {
if (cmd == CommonConstants.OpenFolderInExplorerCmdId) {
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
return VSConstants.S_OK;
}
else if ((VsCommands2K)cmd == VsCommands2K.EXCLUDEFROMPROJECT) {
result |= QueryStatusResult.NOTSUPPORTED | QueryStatusResult.INVISIBLE;
return VSConstants.S_OK;
}
}
return base.QueryStatusOnNode(cmdGroup, cmd, pCmdText, ref result);
}
示例9: QueryStatusOnNode
internal override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result)
{
if (cmdGroup == VsMenus.guidStandardCommandSet2K && (VsCommands2K)cmd == VsCommands2K.ADDCOMPONENTS
|| cmdGroup == VSConstants.CMDSETID.StandardCommandSet12_guid && (VSConstants.VSStd12CmdID)cmd == VSConstants.VSStd12CmdID.AddReferenceProjectOnly)
{
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.INVISIBLE;
return (int)VSConstants.S_OK;
}
return base.QueryStatusOnNode(cmdGroup, cmd, pCmdText, ref result);
}
示例10: QueryStatusOnNode
internal override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result)
{
if (cmdGroup == VsMenus.guidStandardCommandSet2K)
{
if ((VsCommands2K)cmd == VsCommands2K.QUICKOBJECTSEARCH)
{
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
return VSConstants.S_OK;
}
}
else if (cmdGroup == VSProjectConstants.FSharpSendThisReferenceToInteractiveCmd.Guid && cmd == VSProjectConstants.FSharpSendThisReferenceToInteractiveCmd.ID)
{
if (CanBeReferencedFromFSI())
{
result |= QueryStatusResult.SUPPORTED;
if (GetReferenceForFSI() != null)
{
result |= QueryStatusResult.ENABLED;
}
}
return VSConstants.S_OK;
}
else
{
return (int)OleConstants.OLECMDERR_E_UNKNOWNGROUP;
}
return base.QueryStatusOnNode(cmdGroup, cmd, pCmdText, ref result);
}
示例11: QueryStatusOnNode
protected override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result)
{
WixProjectNode projectNode = this.ProjectMgr as WixProjectNode;
if (projectNode != null && projectNode.QueryStatusOnProjectNode(cmdGroup, cmd, ref result))
{
return VSConstants.S_OK;
}
else if (cmdGroup == VsMenus.guidStandardCommandSet2K)
{
if ((VsCommands2K)cmd == VsCommands2K.QUICKOBJECTSEARCH)
{
Guid browseGuid = this.GetBrowseGuid();
if (browseGuid != Guid.Empty)
{
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
}
else
{
result |= QueryStatusResult.NOTSUPPORTED;
}
return VSConstants.S_OK;
}
}
return base.QueryStatusOnNode(cmdGroup, cmd, pCmdText, ref result);
}
示例12: QueryStatusOnNode
internal override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result)
{
if (cmdGroup == VsMenus.guidStandardCommandSet97)
{
switch ((VsCommands)cmd)
{
case VsCommands.AddNewItem:
case VsCommands.AddExistingItem:
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
return VSConstants.S_OK;
}
}
else if (cmdGroup == VsMenus.guidStandardCommandSet2K)
{
if ((VsCommands2K)cmd == VsCommands2K.ADDREFERENCE)
{
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
return VSConstants.S_OK;
}
}
else if(cmdGroup == VSProjectConstants.FSharpSendReferencesToInteractiveCmd.Guid)
{
if (cmd == VSProjectConstants.FSharpSendReferencesToInteractiveCmd.ID)
{
foreach(var reference in EnumReferences())
{
if (!reference.CanBeReferencedFromFSI())
{
continue;
}
result |= QueryStatusResult.SUPPORTED;
if (reference.GetReferenceForFSI() != null)
{
result |= QueryStatusResult.ENABLED;
break;
}
}
return VSConstants.S_OK;
}
}
else
{
return (int)OleConstants.OLECMDERR_E_UNKNOWNGROUP;
}
return base.QueryStatusOnNode(cmdGroup, cmd, pCmdText, ref result);
}
示例13: QueryStatusOnNode
protected override int QueryStatusOnNode(Guid guidCmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result)
{
if (guidCmdGroup == Microsoft.VisualStudio.Project.VsMenus.guidStandardCommandSet2K)
{
switch ((VsCommands2K)cmd)
{
case VsCommands2K.ADDREFERENCE:
result |= QueryStatusResult.NOTSUPPORTED | QueryStatusResult.INVISIBLE;
return VSConstants.S_OK;
}
}
else if (guidCmdGroup == Microsoft.VisualStudio.Project.VsMenus.guidStandardCommandSet97)
{
switch ((VsCommands)cmd)
{
case VsCommands.SetStartupProject:
case VsCommands.Start:
case VsCommands.StartNoDebug:
result |= QueryStatusResult.NOTSUPPORTED | QueryStatusResult.INVISIBLE;
return VSConstants.S_OK;
}
}
return base.QueryStatusOnNode(guidCmdGroup, cmd, pCmdText, ref result);
}
示例14: QueryStatusOnNode
protected override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result)
{
if ((VSConstants.VSStd2KCmdID)cmd == VSConstants.VSStd2KCmdID.ADDREFERENCE)
{
result |= QueryStatusResult.NOTSUPPORTED | QueryStatusResult.INVISIBLE;
return VSConstants.S_OK;
}
return base.QueryStatusOnNode(cmdGroup, cmd, pCmdText, ref result);
}
示例15: QueryStatusOnNode
internal override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result) {
if (cmdGroup == VsMenus.guidStandardCommandSet97) {
switch ((VsCommands)cmd) {
case VsCommands.Copy:
case VsCommands.Cut:
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.INVISIBLE;
return VSConstants.S_OK;
}
} else if (cmdGroup == GuidList.guidPythonToolsCmdSet) {
switch (cmd) {
case PythonConstants.AddEnvironment:
case PythonConstants.AddVirtualEnv:
case PythonConstants.AddExistingVirtualEnv:
case PythonConstants.ViewAllEnvironments:
result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
return VSConstants.S_OK;
}
}
return base.QueryStatusOnNode(cmdGroup, cmd, pCmdText, ref result);
}