本文整理汇总了C#中ResolutionContext.GetTemplateParam方法的典型用法代码示例。如果您正苦于以下问题:C# ResolutionContext.GetTemplateParam方法的具体用法?C# ResolutionContext.GetTemplateParam怎么用?C# ResolutionContext.GetTemplateParam使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ResolutionContext
的用法示例。
在下文中一共展示了ResolutionContext.GetTemplateParam方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResolveIdentifier
/// <summary>
/// Resolves an identifier and returns the definition + its base type.
/// Does not deduce any template parameters or nor filters out unfitting template specifications!
/// </summary>
public static AbstractType[] ResolveIdentifier(int idHash, ResolutionContext ctxt, object idObject, bool ModuleScope = false)
{
var loc = idObject is ISyntaxRegion ? ((ISyntaxRegion)idObject).Location : CodeLocation.Empty;
if (ModuleScope)
ctxt.PushNewScope(ctxt.ScopedBlock.NodeRoot as DModule);
// If there are symbols that must be preferred, take them instead of scanning the ast
else
{
TemplateParameterSymbol dedTemplateParam;
if (ctxt.GetTemplateParam(idHash, out dedTemplateParam))
return new[] { dedTemplateParam };
}
var res = NameScan.SearchAndResolve(ctxt, loc, idHash, idObject);
if (ModuleScope)
ctxt.Pop();
return /*res.Count == 0 ? null :*/ res.ToArray();
}