本文整理汇总了C#中ISignatureHelpSession.Dismiss方法的典型用法代码示例。如果您正苦于以下问题:C# ISignatureHelpSession.Dismiss方法的具体用法?C# ISignatureHelpSession.Dismiss怎么用?C# ISignatureHelpSession.Dismiss使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISignatureHelpSession
的用法示例。
在下文中一共展示了ISignatureHelpSession.Dismiss方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CommaFindBestSignature
private static void CommaFindBestSignature(ISignatureHelpSession sigHelpSession, int curParam, string lastKeywordArg) {
// see if we have a signature which accomodates this...
// TODO: We should also get the types of the arguments and use that to
// pick the best signature when the signature includes types.
var bestSig = sigHelpSession.SelectedSignature as PythonSignature;
if (bestSig != null) {
for (int i = 0; i < bestSig.Parameters.Count; ++i) {
if (bestSig.Parameters[i].Name == lastKeywordArg ||
lastKeywordArg == null && (i == curParam || PythonSignature.IsParamArray(bestSig.Parameters[i].Name))
) {
bestSig.SetCurrentParameter(bestSig.Parameters[i]);
sigHelpSession.SelectedSignature = bestSig;
return;
}
}
}
PythonSignature fallback = null;
foreach (var sig in sigHelpSession.Signatures.OfType<PythonSignature>().OrderBy(s => s.Parameters.Count)) {
fallback = sig;
for (int i = 0; i < sig.Parameters.Count; ++i) {
if (sig.Parameters[i].Name == lastKeywordArg ||
lastKeywordArg == null && (i == curParam || PythonSignature.IsParamArray(sig.Parameters[i].Name))
) {
sig.SetCurrentParameter(sig.Parameters[i]);
sigHelpSession.SelectedSignature = sig;
return;
}
}
}
if (fallback != null) {
fallback.SetCurrentParameter(null);
sigHelpSession.SelectedSignature = fallback;
} else {
sigHelpSession.Dismiss();
}
}