| ParagraphUnitBuffer Class |
The buffer can be turned on and off. While turned on, it caches all paragraph units passed to it through calls on ProcessParagraphUnit(IParagraphUnit). When turned off, the paragraph units are output to the IBilingualContentHandler set as the Output property.
Call Hold to make the buffer start buffering paragraph unit calls. Call Release to have all buffered paragraph units output to the Output content processor and stop buffering calls.
You can access and modify the content of the buffer through the BufferedParagraphUnits property.
Namespace: Sdl.FileTypeSupport.Framework.Core.Utilities.BilingualApi
The ParagraphUnitBuffer type exposes the following members.
| Name | Description | |
|---|---|---|
| ParagraphUnitBuffer |
Default constructor - creates a new empty buffer that is not holding.
| |
| ParagraphUnitBuffer(IBilingualContentHandler) |
Construct with the bilingual content processor that will be used for output
from the buffer.
|
| Name | Description | |
|---|---|---|
| BufferedParagraphUnits |
Provides access to the ParagraphUnits that are currently in the buffer.
| |
| IsEmpty | true if the buffer is empty.
| |
| IsHolding |
Indicates if the buffer is actively buffering calls.
| |
| Output |
When the buffer is not holding calls, all ParagraphUnits will be output
to this interface.
|
| Name | Description | |
|---|---|---|
| Hold |
Start buffering ParagraphUnits.
If the buffer is already holding, this call has no effect.
| |
| ProcessParagraphUnit |
Call this to process a ParagraphUnit.
If the buffer is holding, the paragraph unit will be added to the buffer and output once
the buffer has been released. If not, the paragraph unit will be output immediately.
| |
| Release |
Releases the buffer content by calling the appropriate Process method
for each ParagraphUnit on the Output. Removes all ParagraphUnits from the buffer.
|
This class is used in the implementation of the Native to Bilingual Converter and other implementations in which buffering of bilingual content is necessary.