本文整理汇总了C#中IOleCommandTarget.QueryStatus方法的典型用法代码示例。如果您正苦于以下问题:C# IOleCommandTarget.QueryStatus方法的具体用法?C# IOleCommandTarget.QueryStatus怎么用?C# IOleCommandTarget.QueryStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOleCommandTarget
的用法示例。
在下文中一共展示了IOleCommandTarget.QueryStatus方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsJSLSInstalled
///<summary>Attempts to figure out whether the JSLS language service has been installed yet.</summary>
static bool IsJSLSInstalled(IOleCommandTarget next)
{
Guid cmdGroup = VSConstants.VSStd2K;
var cmds = new[] { new OLECMD { cmdID = (uint)VSConstants.VSStd2KCmdID.AUTOCOMPLETE } };
ErrorHandler.ThrowOnFailure(next.QueryStatus(ref cmdGroup, 1, cmds, IntPtr.Zero));
return cmds[0].cmdf == 3;
}
示例2: WrapQueryStatus
public static int WrapQueryStatus(
IOleCommandTarget receiver,
IOleCommandTarget implementer,
ref System.Guid pguidCmdGroup,
uint cCmds,
OLECMD[] prgCmds,
System.IntPtr pCmdText) {
Debug.Assert(receiver != null);
var commandId = new CommandID(pguidCmdGroup, (int)prgCmds[0].cmdID);
if (LogCommand(commandId)) {
Logger.LogInfo("WrapQueryStatus: => recv={0}, impl={1}, parent={2}",
receiver,
GetImplementerString(implementer),
GetParentTargetString(implementer));
}
var hr = (implementer == null)
? (int)Constants.OLECMDERR_E_NOTSUPPORTED
: implementer.QueryStatus(ref pguidCmdGroup, cCmds, prgCmds, pCmdText);
if (LogCommand(commandId)) {
Logger.LogInfo("WrapQueryStatus: <= recv={0}, impl={1}, parent={2}, hr={3}, cmdf={4}",
receiver,
GetImplementerString(implementer),
GetParentTargetString(implementer),
HrToString(hr),
CmdFlagsToString(prgCmds));
}
return hr;
}
示例3: IsJSLSInstalled
static bool IsJSLSInstalled(IOleCommandTarget next)
{
Guid cmdGroup = VSConstants.VSStd2K;
var cmds = new[] { new OLECMD { cmdID = (uint)VSConstants.VSStd2KCmdID.AUTOCOMPLETE } };
try
{
next.QueryStatus(ref cmdGroup, 1, cmds, IntPtr.Zero);
return cmds[0].cmdf == 3;
}
catch
{
return false;
}
}