示例#1
0
        public InsertedBlock ShelveEnd(StoredState state)
        {
            _sourceWriter.Flush();
            _sourceWriter.Dispose();
            var block = new InsertedBlock
            {
                Content         = _stringBuilder.ToString(),
                IndentDiff      = Indent - state.Indent,
                AddedLinesCount = _currentLine - state.CurrentLine
            };

            _sourceWriter  = state.SourceWriter;
            _stringBuilder = state.StringBuilder;
            Indent         = state.Indent;
            _currentLine   = state.CurrentLine;
            return(block);
        }
示例#2
0
 public void InsertShelvedContent(InsertedBlock block)
 {
     _stringBuilder.Append(block.Content);
     _currentLine += block.AddedLinesCount;
     Indent       += block.IndentDiff;
 }