private void FlushLogicalLine(LogicalLinesHistoryQueue logicalLinesHistoryQueue = null) { if (_logicalLine.IsEmpty) { return; } _logicalLine.IsVisible = !ShouldBeHided() && ShouldBeShown(); if ( (_logicalLine.IsVisible || _afterCounter > 0) && !SkipFromNumLines()) { var forPrinting = new LogicalLinesHistoryQueue(); PrepareLogicalLineForPrinting(_logicalLine, forPrinting); if (logicalLinesHistoryQueue == null) { PrintLogicalLines(forPrinting); } else { logicalLinesHistoryQueue.Enqueue(forPrinting); } if (_logicalLine.IsVisible) { _afterCounter = Configs.ContextAfter; } } _logicalLinesHistoryQueue.Enqueue(_logicalLine); _logicalLine = new LogicalLine(); }
private void PrepareLogicalLineForPrinting(LogicalLine logicalLine, LogicalLinesHistoryQueue prepared) { if (Configs.IsContextBeforeUsed && _logicalLinesHistoryQueue.Any() && _logicalLine.IsVisible) { prepared.Enqueue(_logicalLinesHistoryQueue); _logicalLinesHistoryQueue.Clear(); } prepared.Enqueue(logicalLine); if (_afterCounter > 0) { --_afterCounter; } }