Interface ISideBySideEditor
The side-by-side editor control that coordinates things between the source and target language edit controls that appear side by side inside this control.
Namespace: Sdl.DesktopEditor.EditorApi
Assembly: Sdl.DesktopEditor.EditorApi.dll
Syntax
public interface ISideBySideEditor : IControl, IDisposable
Properties
ActiveEditControl
The edit control that currently is editable, if it is
the source or target edit control, or null
if neither.
Declaration
IFrameworkEditControl ActiveEditControl { get; }
Property Value
Type | Description |
---|---|
IFrameworkEditControl |
ActiveRowNumber
Declaration
int ActiveRowNumber { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
AutoDisposeDocument
Determines if the currently assigned document should be automatically disposed of when another document is assigned and/or when the editor is disposed.
Declaration
bool AutoDisposeDocument { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
The initial value of this property reflects the auto-dispose parameter passed to SetDocument(IBilingualDocument, Boolean).
AutoScrollSource
When true the source edit control is automatically scrolled so that it is aligned with the current selection in the target edit control when the selection in the target control is moved.
Declaration
bool AutoScrollSource { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
When this property is false
the source edit control can still be
explicitly scrolled to align it with the current selection in the
target edit control by calling ScrollSourceToTargetSelection().
DisplaySettings
The display settings that will be used in both the source and target edit controls.
Declaration
EditControlDisplaySettings DisplaySettings { get; }
Property Value
Type | Description |
---|---|
EditControlDisplaySettings |
Document
The bilingual document that contains the content shown in the source and target editors.
Declaration
IBilingualDocument Document { get; }
Property Value
Type | Description |
---|---|
IBilingualDocument |
Remarks
Assign a document to the editor by calling SetDocument(IBilingualDocument, Boolean).
If the AutoDisposeDocument property is true
this document
will be disposed by the editor when it is no longer needed. To get notifications
when the document is disposed, connect to the Disposing event.
DocumentEditingUser
Sets the user to be used for revisions
Declaration
string DocumentEditingUser { set; }
Property Value
Type | Description |
---|---|
System.String |
EnableImplicitRowActivation
When true
, row activation will occur when the user row selection changes.
When false
, row activation will only occur when the user manually activates it.
Declaration
bool EnableImplicitRowActivation { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
FocusedControl
The edit control that currently has input focus, if it is
the source or target edit control, or null
if neither.
Declaration
IFrameworkEditControl FocusedControl { get; }
Property Value
Type | Description |
---|---|
IFrameworkEditControl |
HideFileTags
When true
, segments containing file tags are hidden.
Declaration
bool HideFileTags { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
HideHideableTags
When true
any tags with CanHide
set to true
will not be shown in the editor.
Declaration
bool HideHideableTags { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Hidden tags can still be manipulated through normal editing operations in the surrounding text, so they may get accidentally deleted!
When source and target use different settings this property is false.
HideTextTooltips
Allows hiding and restoration of tooltips on text nodes. This affects, for example, text inside a commented or revision marked range.
Declaration
bool HideTextTooltips { set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsInitialUpdateCompleted
true
when the control has been fully initialized. This is set just
before the AfterInitialUpdate event is raised.
Declaration
bool IsInitialUpdateCompleted { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
When a different document is assigned to the control this property may
be false
until the control has been updated to reflect the new content.
LayoutSynchronizer
To synchronize cell height between source and target controls every ISideBySideEditor implementation must provide a LayoutSynchronizer.
Declaration
ILayoutSynchronizer LayoutSynchronizer { get; }
Property Value
Type | Description |
---|---|
ILayoutSynchronizer |
ProjectEditorConfig
Editor configuration based on Project restrictions (secure mode/ normal mode)
Declaration
ProjectEditorSettings ProjectEditorConfig { get; set; }
Property Value
Type | Description |
---|---|
ProjectEditorSettings |
RowVisibilityDelegate
The delegate that will be used when calculating which rows are visible and which are hidden in the edit control.
Declaration
Predicate<IRowInfo> RowVisibilityDelegate { get; set; }
Property Value
Type | Description |
---|---|
System.Predicate<IRowInfo> |
ShowSourceSegmentIdColumn
Determines whether the left segment column id will be displayed
Declaration
bool ShowSourceSegmentIdColumn { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ShowWhitespaceCharacters
When true
whitespace characters such as space, tab, non-breaking spaces etc. are
shown with symbols in both the source and target editor (default is false
).
Declaration
bool ShowWhitespaceCharacters { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
When source and target use different settings this property is false
.
Source
The edit control showing the source language content in the side-by-side editor.
Declaration
IFrameworkEditControl Source { get; }
Property Value
Type | Description |
---|---|
IFrameworkEditControl |
SourceRowNumberProvider
Gets or sets an optional source row provider (used in Alignment target editor context). The provider should return -1 when a correspondent row doesn't exist.
Declaration
CorrespondenceProvider SourceRowNumberProvider { get; set; }
Property Value
Type | Description |
---|---|
CorrespondenceProvider |
SplitContainer
The splitter control that hosts the source and target controls.
Declaration
SplitContainer SplitContainer { get; }
Property Value
Type | Description |
---|---|
System.Windows.Forms.SplitContainer |
SuppressFormatting
When true
all semi-WYSIWYG formatting information will be ignored
and all text in the source and target controls will be formatted using the default font and
foreground color of the respective Control.
Declaration
bool SuppressFormatting { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
This setting is off by default.
NOTE: It is important to set the HideHideableTags to true
if this setting is enabled, otherwise there will be no visual indication
to the presence of hidden tags, as the surrounding text will all have the
same formatting.
Changing this setting will affect the corresponding setting on both the source
and target controls. If the source and target have different settings the value of this
property will be false
.
Note that font fallback will still be in effect, which may cause a different font to be used for characters that cannot be displayed using the default font.
TagDisplayMode
The display mode for tags in both source and target edit controls.
Declaration
TagDisplayMode TagDisplayMode { get; set; }
Property Value
Type | Description |
---|---|
TagDisplayMode |
Remarks
If source and target uses different tag display modes this property
returns TagDisplayMode.Unspecified
.
Changing this property will cause the source and target content to be re-formatted.
Target
The edit control showing the target language content in the side-by-side editor.
Declaration
IFrameworkEditControl Target { get; }
Property Value
Type | Description |
---|---|
IFrameworkEditControl |
Methods
Redo()
Performs a redo operation on the correct edit control and updates the caret position in both the source and target controls.
Declaration
bool Redo()
Returns
Type | Description |
---|---|
System.Boolean |
|
RedoMultiple(Int64)
Performs multiple redo operations on the correct edit controls and updates the caret position in both the source and target controls.
Declaration
bool RedoMultiple(long count)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | count |
Returns
Type | Description |
---|---|
System.Boolean |
|
Redraw()
Force a re-layout, re-draw and refresh of the content of both the source and the target control.
Declaration
void Redraw()
Remarks
Call this method to update the editor if the document content has changed as the result of external API operations, e.g. after loading a document from a file.
ScrollSourceToTargetSelection()
Scrolls the source edit control so that the active end of the current selection in the target is aligned with the corresponding source content.
Declaration
void ScrollSourceToTargetSelection()
SetDocument(IBilingualDocument, Boolean)
Assigns the specified document to the editor. The document can thereafter be accessed from the Document property, and the content of the document is shown in the source and target edit controls.
Declaration
void SetDocument(IBilingualDocument document, bool autoDispose)
Parameters
Type | Name | Description |
---|---|---|
IBilingualDocument | document | The document who's content should be displayed in the edit controls,
or |
System.Boolean | autoDispose | Determines whether the control should call Dispose() on the document when it is no longer needed (i.e. when another document is set, or when the editor is disposed). |
Remarks
The auto-dispose flag indicates whether the control should take ownership of the document, and automatically dispose of it when it is no longer needed. This behavior can be changed at a later stage by setting the AutoDisposeDocument property. If auto-dispose is not set it is the responsibility of the application to ensure that the document gets properly disposed of when no longer needed. This is important, as the document can not be garbage collected until it has been explicitly disposed.
IMPORTANT: This operation will cause the source and target edit control instances to be destroyed and re-created. Any external event handlers connected to the original source and target controls should be disconnected before this call and (if desired) re-connected to the new controls after this operation.
Passing null
for the document will render the source and target controls empty.
ToggleFocus()
Toggles the focus between the source and target and moves the selection to the start of the equivalent row in the focused control.
Declaration
void ToggleFocus()
Undo()
Performs an undo operation on the correct edit control and updates the caret position in both the source and target controls.
Declaration
bool Undo()
Returns
Type | Description |
---|---|
System.Boolean |
|
UndoMultiple(Int64)
Performs multiple undo operations on the correct edit controls and updates the caret position in both the source and target controls.
Declaration
bool UndoMultiple(long count)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | count |
Returns
Type | Description |
---|---|
System.Boolean |
|
UpdateActiveRow(IEditControl)
Updates the active row in the editor to match the position of the current selection
Declaration
void UpdateActiveRow(IEditControl editControl)
Parameters
Type | Name | Description |
---|---|---|
IEditControl | editControl |
Events
ActiveRowChanged
Fired whenever the active row changes.
Declaration
event EventHandler<ActiveRowChangedEventArgs> ActiveRowChanged
Event Type
Type | Description |
---|---|
System.EventHandler<ActiveRowChangedEventArgs> |
AfterEditControlsCreated
Raised after the source and target edit controls have been created. This allows external components to add, for example, custom columns to the side-by-side editor at a controlled point.
Declaration
event EventHandler<AfterEditControlsCreatedEventArgs> AfterEditControlsCreated
Event Type
Type | Description |
---|---|
System.EventHandler<AfterEditControlsCreatedEventArgs> |
AfterInitialUpdate
Raised when the visible area of both the source and the target control has been fully laid out and painted for the first time. This event will be raised also if a different document is assigned to the control (after the initial update resulting from that).
Declaration
event EventHandler<AfterInitialUpdateEventArgs> AfterInitialUpdate
Event Type
Type | Description |
---|---|
System.EventHandler<AfterInitialUpdateEventArgs> |
FocusedControlChanged
Fired when the source or target edit control gets or loses focus.
Declaration
event EventHandler<FocusedControlChangedEventArgs> FocusedControlChanged
Event Type
Type | Description |
---|---|
System.EventHandler<FocusedControlChangedEventArgs> |
Remarks
You can also handle focus changes by directly binding to the GotFocus
or LostFocus
events on the Control
events of the Source or Target controls.
SelectionChanged
Fired when the selection changes in the source or target edit control.
Declaration
event EventHandler<SelectionChangedEventArgs> SelectionChanged
Event Type
Type | Description |
---|---|
System.EventHandler<SelectionChangedEventArgs> |