protected virtual void Write(IndentedTextWriter writer, FieldDeclaration member)
        {
            Write(writer, member.CustomAttributes);
            Write(writer, member.Modifiers);
            if (member.Type == null)
            {
                writer.Write("var ");
            }
            else
            {
                Write(writer, member.Type);
                writer.Write(" ");
            }

            WriteIdentifier(writer, member.Name);

            if (member.InitExpression != null)
            {
                writer.Write(" = ");
                Write(writer, member.InitExpression);
            }

            writer.WriteLine(";");
        }
Esempio n. 2
0
 public virtual void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)
 {
     VisitMemberDeclaration(fieldDeclaration);
     Visit(fieldDeclaration.Type);
     Visit(fieldDeclaration.InitExpression);
 }
 public virtual void VisitFieldDeclaration(FieldDeclaration fieldDeclaration)
 {
     VisitMemberDeclaration(fieldDeclaration);
     VisitTypeReferenceIfNotNull(fieldDeclaration.Type);
     Visit(fieldDeclaration.InitExpression);
 }