| IPreviewUpdatedViaSegmentFile Interface |
Namespace: Sdl.FileTypeSupport.Framework.IntegrationApi
The IPreviewUpdatedViaSegmentFile type exposes the following members.
| Name | Description | |
|---|---|---|
| CreateSegmentFile |
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.
| |
| UpdatePreviewFromSegmentFile |
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.
|
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:
When the translation of a segment is updated in the host application, the application calls CreateSegmentFile(SegmentReference) on this interface. The implementation should create a file in the native format containing the source language sentence for the segment. (E.g. by copying the sentence into a hidden document and saving it to a file.) The host application parses this single segment file using the framework, replaces the source language content with the corresponding translation, and saves the resulting content back to native format through the framework. The application then calls UpdatePreviewFromSegmentFile(SegmentReference, TempFileManager) on this interface, passing in the translated native file produced above. The implementation uses this file to update the visible preview. (E.g. by opening the file hidden, copying its content and by replacing the original source sentence with it.)