/CSEdit/CSParse/Parser/Nodes/Using.cs
https://bitbucket.org/floAr/personal · C# · 37 lines · 31 code · 6 blank · 0 comment · 2 complexity · 51fdcf85296c18ea7df980c32ed63720 MD5 · raw file
- 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);
- }
- }
- }