WriteLine() private method

private WriteLine ( ) : void
return void
示例#1
0
 public void VisitArrayInitializer(CodeArrayCreateExpression arr)
 {
     writer.Write("new");
     writer.Write(" ");
     VisitTypeReference(arr.ElementType);
     if (arr.Initializers.Length == 0)
     {
         writer.Write("[0]");
     }
     else
     {
         writer.Write("[]");
         writer.Write(" {");
         writer.WriteLine();
         ++writer.IndentLevel;
         var sep = ",";
         foreach (var initializer in arr.Initializers)
         {
             initializer.Accept(this);
             writer.Write(sep);
             writer.WriteLine();
         }
         --writer.IndentLevel;
         writer.Write("}");
     }
 }
示例#2
0
 public void Write(CodeCompileUnit unit)
 {
     foreach (var n in unit.Namespaces)
     {
         foreach (var comment in n.Comments)
         {
             writer.Write("//");
             writer.Write(comment.Comment);
             writer.WriteLine();
         }
         if (!string.IsNullOrEmpty(n.Name))
         {
             writer.Write("namespace");
             writer.WriteName(" ");
             writer.WriteDottedName(n.Name);
             writer.WriteLine(" {");
             ++writer.IndentLevel;
         }
         foreach (var imp in n.Imports)
         {
             writer.WriteLine();
             writer.Write("using");
             writer.Write(" ");
             writer.WriteDottedName(imp.Namespace);
             writer.WriteLine(";");
         }
         foreach (var type in n.Types)
         {
             writer.WriteLine();
             var tw = new CSharpTypeWriter(type, writer);
             type.Accept(tw);
         }
         if (!string.IsNullOrEmpty(n.Name))
         {
             --writer.IndentLevel;
             writer.WriteLine("}");
         }
     }
 }
示例#3
0
 private void TerminateLine()
 {
     writer.WriteLine();
 }
示例#4
0
        public int VisitField(CodeMemberField field)
        {
            RenderMemberFieldAttributes(field.Attributes);
            var expWriter = new CSharpExpressionWriter(writer);

            expWriter.VisitTypeReference(field.FieldType);
            writer.Write(" ");
            writer.WriteName(field.FieldName);
            if (field.InitExpression != null)
            {
                writer.Write(" = ");
                field.InitExpression.Accept(expWriter);
            }
            writer.Write(";");
            writer.WriteLine();
            return(0);
        }