internal static bool InAsyncMethod(Expression value) { INodeWithBody ancestor = value.GetAncestor <BlockExpression>(); if (ancestor == null) { ancestor = value.GetAncestor <Method>(); } return(ContextAnnotations.IsAsync(ancestor)); }
public static void MarkAsync(INodeWithBody node) { ((Node)node).Annotate(AsyncKey); }
public static void MarkAwaitInExceptionHandler(INodeWithBody node) { ((Node)node).Annotate(AwaitInExceptionHandlerKey); }
public static bool AwaitInExceptionHandler(INodeWithBody node) { return(((Node)node).ContainsAnnotation(AwaitInExceptionHandlerKey)); }
public static bool IsAsync(INodeWithBody node) { return(((Node)node).ContainsAnnotation(AsyncKey)); }