Interface IPreviewUpdatedViaSegmentFile
Implemented by the real-time preview controls and applications that can be updated using a "segment file protocol", i.e. via a file in the orignal document format that contains a single segment.
Namespace: Sdl.FileTypeSupport.Framework.IntegrationApi
Assembly: Sdl.FileTypeSupport.Framework.Core.dll
Syntax
public interface IPreviewUpdatedViaSegmentFile : IAbstractUpdatablePreview
Remarks
Components that implement this interface typically also implement INavigablePreview.
This interface is used by the real-time preview for Microsoft Word documents.
The protocol works as follows:
Methods
CreateSegmentFile(SegmentReference)
Called by the host application to create a native source document containing the source language content of the specified segment. The implementation returns the full path to the file created.
Declaration
TempFileManager CreateSegmentFile(SegmentReference segment)
Parameters
Type | Name | Description |
---|---|---|
SegmentReference | segment | Identifies the segment to create a file for. |
Returns
Type | Description |
---|---|
TempFileManager | Temporary file that has been created. The lifetime of the file is controlled by the returned manager instance. All components that need access to the file should reference this. The file will automatically be deleted when this instance is disposed or garbage collection takes place. |
UpdatePreviewFromSegmentFile(SegmentReference, TempFileManager)
Called by the host application to update the preview with the content of a segment file. The implementation should update the preview by replacing the segment content with the content in the segment file.
Declaration
void UpdatePreviewFromSegmentFile(SegmentReference segment, TempFileManager translatedSegmentFile)
Parameters
Type | Name | Description |
---|---|---|
SegmentReference | segment | |
TempFileManager | translatedSegmentFile | Reference to a native file containing the updated target language version of the segment. The implementation may dispose of this when it is no longer needed. |