personal /CSEdit/CSParse/Parser/Nodes/Using.cs

Language C# Lines 38
MD5 Hash 51fdcf85296c18ea7df980c32ed63720 Estimated Cost $704 (why?)
Repository https://bitbucket.org/floAr/personal View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CSParse
{
    public class UsingNode : ObjectNode, IVisitable
    {
        public override NodeType NodeType { get { return NodeType.Using; } }

        public Reference Name { get; set; }

        public string Alias { get; set; }

        public UsingNode()
        {
        }

        internal override void ToCode(StringBuilder builder, int nestLevel)
        {
            if (this.Alias != null)
            {
                AppendLine(builder, nestLevel, string.Format("using {0}={1};", this.Alias, this.Name));
            }
            else
            {
                AppendLine(builder, nestLevel, string.Format("using {0};", this.Name));
            }
        }

        void IVisitable.Visit(Visitor visitor)
        {
            visitor.VisitUsing(this);
        }
    }
}
Back to Top