Ejemplo n.º 1
0
            // ------------------------- FoldNewLine ---------------------------
            // add a fold ( crlf-space ) to the current line.  This will
            public ChunkPair FoldNewLine(Chunk InSpaceChunk)
            {
                // must be a space chunk
                if (InSpaceChunk.ChunkType != ChunkType.Spaces)
                {
                    throw(new ApplicationException("FoldNewLine method must be passed spaces"));
                }

                // end the current line.
                Chunk eolChunk = new Chunk(ChunkType.EndOfLine);

                CurrentLine.AddChunk(eolChunk);

                // split the space chunk. one char for the fold chunk. the remainder to be
                // placed as processing continues.
                ChunkPair pair = InSpaceChunk.Split(ParentLineBuilder.Traits, 1);

                // the fold chunk is a single space.  ( this is a single space from the
                // unicode string so it has a Bx. )
                Chunk foldChunk = pair.a;

                CurrentLine.AddChunk(foldChunk);

                return(pair);
            }
Ejemplo n.º 2
0
            // ------------------------ FoldNewLine ----------------------------
            // insert a fold at the end of the current line
            public Chunk FoldNewLine( )
            {
                // end the current line.
                Chunk eolChunk = new Chunk(ChunkType.EndOfLine);

                CurrentLine.AddChunk(eolChunk);

                // add the fold to the current empty line.
                Chunk fold = new Chunk(ChunkType.Fold);

                CurrentLine.AddChunk(fold);

                return(fold);
            }