public AstNode VisitUsingDirective(UsingDirectiveNode n) { Append("using "); if (n.Alias != null) { Visit(n.Alias); Append(" = "); } Visit(n.Namespace); Append(";"); return(n); }
/// <summary> /// Adds a using directive for the current context. /// </summary> public void AddUsingDirective(UsingDirectiveNode node) { NamespaceLevel currentLevel = levels.Peek() as NamespaceLevel; if (currentLevel == null) { throw new InvalidOperationException("Can not add a using directive in a type."); } currentLevel.UsingDirectives.Add(node); if (node.IsAlias) { couldBeAlias[node.AliasName.Identifier] = null; } }
/// <summary> /// Adds a using directive for the current context. /// </summary> public void AddUsingDirective(UsingDirectiveNode node) { NamespaceLevel currentLevel = this.levels.Peek() as NamespaceLevel; if (currentLevel == null) throw new InvalidOperationException("Can not add a using directive in a type."); currentLevel.UsingDirectives.Add(node); }
/// <summary> /// Adds a using directive for the current context. /// </summary> public void AddUsingDirective(UsingDirectiveNode node) { NamespaceLevel currentLevel = levels.Peek() as NamespaceLevel; if (currentLevel == null) throw new InvalidOperationException("Can not add a using directive in a type."); currentLevel.UsingDirectives.Add(node); if(node.IsAlias) couldBeAlias[node.AliasName.Identifier] = null; }
public virtual AstNode VisitUsingDirective(UsingDirectiveNode n) { Visit(n.Alias); Visit(n.Namespace); return(n); }