예제 #1
0
        internal static bool InAsyncMethod(Expression value)
        {
            INodeWithBody ancestor = value.GetAncestor <BlockExpression>();

            if (ancestor == null)
            {
                ancestor = value.GetAncestor <Method>();
            }
            return(ContextAnnotations.IsAsync(ancestor));
        }
예제 #2
0
 public static void MarkAsync(INodeWithBody node)
 {
     ((Node)node).Annotate(AsyncKey);
 }
예제 #3
0
 public static void MarkAwaitInExceptionHandler(INodeWithBody node)
 {
     ((Node)node).Annotate(AwaitInExceptionHandlerKey);
 }
예제 #4
0
 public static bool AwaitInExceptionHandler(INodeWithBody node)
 {
     return(((Node)node).ContainsAnnotation(AwaitInExceptionHandlerKey));
 }
예제 #5
0
 public static bool IsAsync(INodeWithBody node)
 {
     return(((Node)node).ContainsAnnotation(AsyncKey));
 }