public ElseSyntax(IfSyntax pIf, BlockSyntax pBlock) { If = pIf; Body = pBlock; if (If != null) { If.Parent = this; } if (Body != null) { Body.Parent = this; } }
public virtual void Visit(IfSyntax pNode) { pNode.Condition.Accept(this); pNode.Body.Accept(this); pNode.Else?.Accept(this); }
public virtual SyntaxNode Visit(IfSyntax pNode) { return(SyntaxFactory.If(pNode.Condition.Accept <ExpressionSyntax>(this), pNode.Body.Accept <BlockSyntax>(this), pNode.Else?.Accept <ElseSyntax>(this)).WithAttributes(pNode)); }
public static ElseSyntax Else(IfSyntax pIf, BlockSyntax pBody) { return(new ElseSyntax(pIf, pBody)); }