Interface ILayoutSynchronizer
Ensures the synchronization of rows between multiple
Namespace: SdlSdl.DesktopEditorEditorApi
Assembly: Sdl.DesktopEditor.EditorApi.dll
Syntax
public interface ILayoutSynchronizer
Remarks
Properties
IsSynchronizationSuspended
Read-only property that indicates if synchronization is currently suspended while waiting for all layouts to call NotifyStructureChanging()
Declaration
bool IsSynchronizationSuspended { get; }
Property Value
Type | Description |
---|---|
bool |
Methods
CellHeightChanged(ISynchronizableCell, int, ISynchronizableLayout)
Inform the layout synchronizer that the height of the specified cell in the given layout has changed.
Declaration
void CellHeightChanged(ISynchronizableCell cell, int newHeight, ISynchronizableLayout layout)
Parameters
Type | Name | Description |
---|---|---|
ISynchronizableCell | cell | The cell that has changed. |
int | newHeight | The requested new height of the cell (the cell may not yet have been updated) |
ISynchronizableLayout | layout | The layout this change applies to. |
GetRowHeight(ISynchronizableCell, ISynchronizableLayout)
Called by controls to determine the current height to be used for the specified cell.
Declaration
int GetRowHeight(ISynchronizableCell cell, ISynchronizableLayout layout)
Parameters
Type | Name | Description |
---|---|---|
ISynchronizableCell | cell | The cell in the layout the query refers to. This is used to locate the correct row. |
ISynchronizableLayout | layout | The layout that is requesting the current row height |
Returns
Type | Description |
---|---|
int | the height of the row |
Remarks
This is used by controls to determine the max height of all synchronized cells in the row, e.g. to determine if the content will fit in this row. If it does not fit the control should call CellHeightChanged(ISynchronizableCell, int, ISynchronizableLayout) to communicate the new required cell height to all other synchronized cells.
NotifyLayoutCompleted(ISynchronizableLayout)
Controls call this when they are able to draw all visible layout items in the display area. The synchronizer will wait for all registered controls to call this method before asking them to draw.
Declaration
void NotifyLayoutCompleted(ISynchronizableLayout layout)
Parameters
Type | Name | Description |
---|---|---|
ISynchronizableLayout | layout |
NotifyStructureChanging(ISynchronizableLayout)
Notify the layout synchronizer that the structure to be synchronized needs changing.
Declaration
void NotifyStructureChanging(ISynchronizableLayout layout)
Parameters
Type | Name | Description |
---|---|---|
ISynchronizableLayout | layout |
Remarks
The synchronized cells for the specified layout will be removed from the synchronizer as part of this call. Synchronization will be suspended for all layouts until all of them have called this method. Once that happens the synchronizer will call StructureChanged() on each of the registered layouts. The implementaiton of this method would then typically register all synchronizable cells in the layout (using the new common structure).
RegisterCell(ISynchronizableCell, ISynchronizableLayout)
Register a cell for synchronization against the layout provided.
Declaration
void RegisterCell(ISynchronizableCell cell, ISynchronizableLayout layout)
Parameters
Type | Name | Description |
---|---|---|
ISynchronizableCell | cell | The cell to be registered. |
ISynchronizableLayout | layout | The layout in which the cell belongs. |
Remarks
In earlier implementations it was required that cell registration followed the same pattern for each layout, however this requirement has been lifted now that each synchronizable cell has a row associated with it. The row number will be used for the synchronization, i.e. cells with the same row number will be synchronized across the different layouts.
UnregisterAll(ISynchronizableLayout)
Shortcut to unregister all registered cells for the specified layout.
Declaration
void UnregisterAll(ISynchronizableLayout layout)
Parameters
Type | Name | Description |
---|---|---|
ISynchronizableLayout | layout |
UnregisterCell(ISynchronizableCell, ISynchronizableLayout)
Unregister a cell for synchronization against the layout provided.
Declaration
void UnregisterCell(ISynchronizableCell cell, ISynchronizableLayout layout)
Parameters
Type | Name | Description |
---|---|---|
ISynchronizableCell | cell | The cell to be unregistered. |
ISynchronizableLayout | layout | The layout in which the cell belongs. |