예제 #1
0
        void SerializeArray(Container container, ArrayStyle style, bool IsAnonymous = false)
        {
            if (!IsAnonymous)
            {
                LineFeed(style.lineBreak);
                if (style.lineBreak)
                {
                    Indentation();
                }
            }
            writer.Append(style.begin);
            LineFeed(style.lineBreak);
            bool firstItem = true;

            foreach (Node node in container)
            {
                if (!firstItem)
                {
                    writer.Append(style.mid);
                    LineFeed(style.lineBreak);
                }
                firstItem = false;

                IndentationIn();
                SerializeNode(node, style.lineBreak);
                writer.Append(style.tail);
                IndentationOff();
            }
            LineFeed(style.lineBreak);
            if (style.lineBreak)
            {
                Indentation();
            }
            writer.Append(style.end);
        }
예제 #2
0
 public Style(ArrayStyle attriStyle, ArrayStyle curlyStyle, bool lineBreak, bool indentation, bool space, bool inverse, bool hasHeader)
 {
     this.attriStyle       = attriStyle;
     this.curlyStyle       = curlyStyle;
     this.hasLineBreak     = lineBreak;
     this.hasIndentation   = indentation;
     this.hasSpace         = space;
     this.hasInverseSignal = inverse;
     this.hasHeader        = hasHeader;
 }