本文整理汇总了C#中Microsoft.CodeAnalysis.CSharp.Symbols.NamedTypeSymbol.GetDelegateType方法的典型用法代码示例。如果您正苦于以下问题:C# NamedTypeSymbol.GetDelegateType方法的具体用法?C# NamedTypeSymbol.GetDelegateType怎么用?C# NamedTypeSymbol.GetDelegateType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.CodeAnalysis.CSharp.Symbols.NamedTypeSymbol
的用法示例。
在下文中一共展示了NamedTypeSymbol.GetDelegateType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetCacheKey
private static MethodSymbol GetCacheKey(NamedTypeSymbol delegateType)
{
delegateType = delegateType.GetDelegateType();
if (delegateType != null)
{
var invoke = delegateType.DelegateInvokeMethod;
if (invoke != null)
{
return invoke;
}
}
// delegateType or DelegateInvokeMethod can be null in cases of malformed delegates
// in such case we would want something trivial with no parameters, like a fake static ctor
return new SynthesizedStaticConstructor(delegateType);
}
示例2: DelegateNeedsReturn
private bool DelegateNeedsReturn(NamedTypeSymbol delegateType)
{
NamedTypeSymbol d = delegateType.GetDelegateType();
if ((object)d == null || (object)d.DelegateInvokeMethod == null || d.DelegateInvokeMethod.ReturnsVoid)
{
return false;
}
if (IsAsync && this.binder.Compilation.GetWellKnownType(WellKnownType.System_Threading_Tasks_Task) == d.DelegateInvokeMethod.ReturnType)
{
return false;
}
return true;
}
示例3: DelegateReturnType
private static TypeSymbol DelegateReturnType(NamedTypeSymbol delegateType)
{
NamedTypeSymbol d = delegateType.GetDelegateType();
return ((object)d == null || (object)d.DelegateInvokeMethod == null) ? null : d.DelegateInvokeMethod.ReturnType;
}
示例4: DelegateParameters
private static ImmutableArray<ParameterSymbol> DelegateParameters(NamedTypeSymbol delegateType)
{
NamedTypeSymbol d = delegateType.GetDelegateType();
return ((object)d == null || (object)d.DelegateInvokeMethod == null) ? ImmutableArray<ParameterSymbol>.Empty : d.DelegateInvokeMethod.Parameters;
}
示例5: DelegateInvokeMethod
private static MethodSymbol DelegateInvokeMethod(NamedTypeSymbol delegateType)
{
return delegateType.GetDelegateType()?.DelegateInvokeMethod;
}
示例6: DelegateReturnType
private static TypeSymbol DelegateReturnType(NamedTypeSymbol delegateType, out RefKind refKind)
{
NamedTypeSymbol d = delegateType.GetDelegateType();
if ((object)d == null || (object)d.DelegateInvokeMethod == null)
{
refKind = Microsoft.CodeAnalysis.RefKind.None;
return null;
}
refKind = d.DelegateInvokeMethod.RefKind;
return d.DelegateInvokeMethod.ReturnType;
}