Search Results for

    Show / Hide Table of Contents

    Class AbstractSingleFileRefreshablePreviewController

    Implement this class for single file previews. Override the required properties and methods

    Inheritance
    System.Object
    AbstractSingleFileRefreshablePreviewController
    Implements
    ISingleFileRefreshablePreview
    ISingleFilePreviewControl
    IAbstractPreviewControl
    IAbstractPreviewController
    ISingleFilePreviewController
    INavigablePreview
    System.IDisposable
    IFileTypeDefinitionAware
    IPreviewUpdatedViaSegmentFile
    IPreviewUpdatedViaRefresh
    IAbstractUpdatablePreview
    Namespace: Sdl.FileTypeSupport.Framework.IntegrationApi
    Assembly: Sdl.FileTypeSupport.Framework.Core.dll
    Syntax
    public abstract class AbstractSingleFileRefreshablePreviewController : AbstractSettingsBundleAware, ISingleFileRefreshablePreview, ISingleFilePreviewControl, IAbstractPreviewControl, IAbstractPreviewController, ISingleFilePreviewController, INavigablePreview, IDisposable, IFileTypeDefinitionAware, IPreviewUpdatedViaSegmentFile, IPreviewUpdatedViaRefresh, IAbstractUpdatablePreview

    Constructors

    AbstractSingleFileRefreshablePreviewController()

    Declaration
    protected AbstractSingleFileRefreshablePreviewController()

    Properties

    Control

    The actual Windows Forms control for the preview display

    Declaration
    public virtual Control Control { get; }
    Property Value
    Type Description
    System.Windows.Forms.Control
    Remarks

    This property provides direct access to the control. It is used by host applications that host the control to set its size and other standard properties.

    FileTypeDefinition

    FileTypeDefinition

    Declaration
    public IFileTypeDefinition FileTypeDefinition { get; set; }
    Property Value
    Type Description
    IFileTypeDefinition

    PreferredHighlightColor

    Set by the host application to indicate the preferred color to be used for highlighting the current segment in the preview when NavigateToSegment(SegmentReference) is called.

    Declaration
    public virtual Color PreferredHighlightColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color
    Remarks

    Using the highlight color is optional, but leads to an enhanced user experience. This will typically be the same color as the background color that is used for the active segment row in the editor, which makes it easier for the user to see that the two segments (i.e. from the bilingual document and the preview) relate to each other.

    PreviewFile

    Full path to the file that should be displayed in the preview

    Declaration
    public virtual TempFileManager PreviewFile { get; set; }
    Property Value
    Type Description
    TempFileManager
    Remarks

    The host application sets this path after generating the preview file before calling Refresh() or Launch() in order to display the file.

    The file is passed through a temporary file manager, which means that it should be deleted automatically when it is no longer needed.

    RefreshPreview

    RefreshPreview should be set to true in the controller if a full preview regeneration is needed

    Declaration
    public bool RefreshPreview { get; set; }
    Property Value
    Type Description
    System.Boolean

    TargetFilePath

    Full path to the target language file that is overwritten when the preview is refreshed. This path is typically set once and stays unchanged during the lifetime of the preview.

    Declaration
    public virtual TempFileManager TargetFilePath { get; set; }
    Property Value
    Type Description
    TempFileManager

    Methods

    AfterFileRefresh()

    Called by the host application after the preview file has been successfully overwritten.

    Declaration
    public virtual void AfterFileRefresh()
    Remarks

    The implementation typically re-loads (refreshes) the file in the preview and (if necessary) navigates to the previously displaying content.

    BeforeFileRefresh()

    Called by the host application when the preview is about to be updated, before the file at TargetFilePath is overwritten.

    Declaration
    public virtual void BeforeFileRefresh()
    Remarks

    This call allows the implementation to release any file locks and/or try to 'remember' the current location of the file before it is overwritten.

    CreateSegmentFile(SegmentReference)

    Called when a segment file should be created

    Declaration
    public virtual TempFileManager CreateSegmentFile(SegmentReference segment)
    Parameters
    Type Name Description
    SegmentReference segment
    Returns
    Type Description
    TempFileManager

    Dispose()

    Dispose

    Declaration
    public virtual void Dispose()

    NavigateToSegment(SegmentReference)

    Called by the host application to request that the preview should scroll to the specified segment.

    Declaration
    public virtual void NavigateToSegment(SegmentReference segment)
    Parameters
    Type Name Description
    SegmentReference segment
    Remarks

    The implementation may specifically highlight the segment in the preview (if possible).

    OnSegmentSelected(SegmentSelectedEventArgs)

    Called to fire the SegmentSelected event

    Declaration
    public void OnSegmentSelected(SegmentSelectedEventArgs args)
    Parameters
    Type Name Description
    SegmentSelectedEventArgs args

    Refresh()

    Called when a document preview first needs to be been displayed and subsequently each time the document preview needs to be been updated.

    Declaration
    public virtual void Refresh()
    Remarks

    This preview control may also need to call the contained preview generator object's IAbstractPreviewGenerator.Refresh() method to ensure that a new preview file has been created or has been updated, and is ready to be viewed.

    UpdatePreviewFromSegmentFile(SegmentReference, TempFileManager)

    Called when the Preview should be updated from a segment file

    Declaration
    public virtual void UpdatePreviewFromSegmentFile(SegmentReference segment, TempFileManager translatedSegmentFile)
    Parameters
    Type Name Description
    SegmentReference segment
    TempFileManager translatedSegmentFile

    Events

    SegmentSelected

    Raised when the user interacts with the preview, selecting a different segment than the one that is currently highlighted.

    Declaration
    public event EventHandler<SegmentSelectedEventArgs> SegmentSelected
    Event Type
    Type Description
    System.EventHandler<SegmentSelectedEventArgs>
    Remarks

    The host application typically handles this event by changing the active segment in the editor to the one that the user has selected in the preview.

    Implements

    ISingleFileRefreshablePreview
    ISingleFilePreviewControl
    IAbstractPreviewControl
    IAbstractPreviewController
    ISingleFilePreviewController
    INavigablePreview
    System.IDisposable
    IFileTypeDefinitionAware
    IPreviewUpdatedViaSegmentFile
    IPreviewUpdatedViaRefresh
    IAbstractUpdatablePreview

    On this page

    • Constructors
      • AbstractSingleFileRefreshablePreviewController()
    • Properties
      • Control
      • FileTypeDefinition
      • PreferredHighlightColor
      • PreviewFile
      • RefreshPreview
      • TargetFilePath
    • Methods
      • AfterFileRefresh()
      • BeforeFileRefresh()
      • CreateSegmentFile(SegmentReference)
      • Dispose()
      • NavigateToSegment(SegmentReference)
      • OnSegmentSelected(SegmentSelectedEventArgs)
      • Refresh()
      • UpdatePreviewFromSegmentFile(SegmentReference, TempFileManager)
    • Events
      • SegmentSelected
    • Implements
    Back to top Generated by DocFX