예제 #1
0
        public AstNode VisitUsingDirective(UsingDirectiveNode n)
        {
            Append("using ");
            if (n.Alias != null)
            {
                Visit(n.Alias);
                Append(" = ");
            }

            Visit(n.Namespace);
            Append(";");
            return(n);
        }
예제 #2
0
        /// <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;
            }
        }
예제 #3
0
        /// <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);
        }
예제 #4
0
        /// <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;
        }
예제 #5
0
 public virtual AstNode VisitUsingDirective(UsingDirectiveNode n)
 {
     Visit(n.Alias);
     Visit(n.Namespace);
     return(n);
 }