Class EditControlDisplaySettings
Provides access to the display settings that will be used by the edit control when displaying fonts, colors and other formatting on screen.
Inherited Members
Namespace: SdlSdl.DesktopEditorEditorApiImplementation
Assembly: Sdl.DesktopEditor.EditorApi.dll
Syntax
public class EditControlDisplaySettings
Constructors
EditControlDisplaySettings()
Default constructor
Declaration
public EditControlDisplaySettings()
Fields
DefaultActiveSegmentColor
Default setting for the active segment color.
Declaration
protected readonly Color DefaultActiveSegmentColor
Field Value
Type | Description |
---|---|
Color |
DefaultAdaptFontColors
Default setting for enabling of font color adaptation.
Declaration
protected readonly bool DefaultAdaptFontColors
Field Value
Type | Description |
---|---|
bool |
DefaultAdaptFontSizes
Default setting for enabling of font size adaptation.
Declaration
protected readonly bool DefaultAdaptFontSizes
Field Value
Type | Description |
---|---|
bool |
DefaultColorDifferenceRatio
Default setting for the color difference ratio when applying font color adaptation.
Declaration
protected readonly int DefaultColorDifferenceRatio
Field Value
Type | Description |
---|---|
int |
DefaultDocumentBackgroundColor
Default setting for the document background color.
Declaration
protected readonly Color DefaultDocumentBackgroundColor
Field Value
Type | Description |
---|---|
Color |
DefaultDocumentTextColor
Default setting for the default document text color.
Declaration
protected readonly Color DefaultDocumentTextColor
Field Value
Type | Description |
---|---|
Color |
DefaultMaxFontSize
Default setting for maximum font adaptation size.
Declaration
protected readonly int DefaultMaxFontSize
Field Value
Type | Description |
---|---|
int |
DefaultMinFontSize
Default setting for minimum font adaptation size.
Declaration
protected readonly int DefaultMinFontSize
Field Value
Type | Description |
---|---|
int |
DefaultReadOnlySegmentColor
Default setting for the read-only segment color.
Declaration
protected readonly Color DefaultReadOnlySegmentColor
Field Value
Type | Description |
---|---|
Color |
DefaultSegmentShadingRatio
Default setting for the segment shading ratio.
Declaration
protected readonly byte DefaultSegmentShadingRatio
Field Value
Type | Description |
---|---|
byte |
DefaultSelectedSegmentColor
Default setting for the selected segment color.
Declaration
protected readonly Color DefaultSelectedSegmentColor
Field Value
Type | Description |
---|---|
Color |
DefaultShowTrackedChanges
Default setting for the color difference ratio when applying font color adaptation.
Declaration
protected MarkupDisplayMode DefaultShowTrackedChanges
Field Value
Type | Description |
---|---|
MarkupDisplayMode |
DefaultSpellingUnderlineColor
Default setting for the spell-checking underline color.
Declaration
protected readonly Color DefaultSpellingUnderlineColor
Field Value
Type | Description |
---|---|
Color |
DefaultTMPlaceableUnderlineColor
Default setting for the TM placeable underline color.
Declaration
protected readonly Color DefaultTMPlaceableUnderlineColor
Field Value
Type | Description |
---|---|
Color |
DefaultTagFormatHighlightColor
Default setting for the tag format highlight color.
Declaration
protected readonly Color DefaultTagFormatHighlightColor
Field Value
Type | Description |
---|---|
Color |
Properties
ActiveSegmentColor
The background color used when displaying the active segment.
Declaration
public Color ActiveSegmentColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
AdaptFontColors
Whether font color adaptation is enabled or not
Declaration
public bool AdaptFontColors { get; set; }
Property Value
Type | Description |
---|---|
bool |
AdaptFontSizes
Whether font size adaptation is enabled or not
Declaration
public bool AdaptFontSizes { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
This property has been deprecated by EditControlFontSizeSettings.AdaptFontSizes.
See Also
AddedTQAFormatting
The formatting that will be used when displaying TQA content which has been added
Declaration
public IFormattingGroup AddedTQAFormatting { get; set; }
Property Value
Type | Description |
---|---|
IFormattingGroup |
ColorDifferenceRatio
The text-to-background color difference ratio to apply to font colors.
Declaration
public int ColorDifferenceRatio { get; set; }
Property Value
Type | Description |
---|---|
int |
CommentTQAFormatting
The formatting that will be used when displaying TQA content which has been commented
Declaration
public IFormattingGroup CommentTQAFormatting { get; set; }
Property Value
Type | Description |
---|---|
IFormattingGroup |
DefaultAddedTQAFormatting
Gets the default added TQA formatting.
Declaration
protected FormattingGroup DefaultAddedTQAFormatting { get; }
Property Value
Type | Description |
---|---|
FormattingGroup |
DefaultCommentTQAFormatting
Gets the default commented TQA formatting.
Declaration
protected FormattingGroup DefaultCommentTQAFormatting { get; }
Property Value
Type | Description |
---|---|
FormattingGroup |
DefaultDeletedTQAFormatting
Gets the default deleted TQA formatting.
Declaration
protected FormattingGroup DefaultDeletedTQAFormatting { get; }
Property Value
Type | Description |
---|---|
FormattingGroup |
DefaultDeletedTagProperties
Gets the default deleted tag properties.
Declaration
protected TagPaintingProperties DefaultDeletedTagProperties { get; }
Property Value
Type | Description |
---|---|
TagPaintingProperties |
DefaultDocumentTagProperties
Gets the default document tag properties.
Declaration
protected TagPaintingProperties DefaultDocumentTagProperties { get; }
Property Value
Type | Description |
---|---|
TagPaintingProperties |
DefaultErrorCommentFormatting
Gets the default error comment formatting.
Declaration
protected FormattingGroup DefaultErrorCommentFormatting { get; }
Property Value
Type | Description |
---|---|
FormattingGroup |
DefaultFileTagProperties
Gets the default file tag properties.
Declaration
protected TagPaintingProperties DefaultFileTagProperties { get; }
Property Value
Type | Description |
---|---|
TagPaintingProperties |
DefaultInformationCommentFormatting
Gets the default information comment formatting.
Declaration
protected FormattingGroup DefaultInformationCommentFormatting { get; }
Property Value
Type | Description |
---|---|
FormattingGroup |
DefaultInsertedRevisionFormatting
Gets the default inserted revision formatting.
Declaration
protected FormattingGroup DefaultInsertedRevisionFormatting { get; }
Property Value
Type | Description |
---|---|
FormattingGroup |
DefaultInsertedTagProperties
Gets the default inserted tag properties.
Declaration
protected TagPaintingProperties DefaultInsertedTagProperties { get; }
Property Value
Type | Description |
---|---|
TagPaintingProperties |
DefaultInternalTagProperties
Gets the default internal tag properties.
Declaration
protected TagPaintingProperties DefaultInternalTagProperties { get; }
Property Value
Type | Description |
---|---|
TagPaintingProperties |
DefaultLockedContentFormatting
Gets the default locked content formatting.
Declaration
protected FormattingGroup DefaultLockedContentFormatting { get; }
Property Value
Type | Description |
---|---|
FormattingGroup |
DefaultRemovedRevisionFormatting
Gets the default removed revision formatting.
Declaration
protected FormattingGroup DefaultRemovedRevisionFormatting { get; }
Property Value
Type | Description |
---|---|
FormattingGroup |
DefaultStructureInfoColors
Gets the default structure info colors.
Declaration
protected ObservableDictionary<string, Color> DefaultStructureInfoColors { get; }
Property Value
Type | Description |
---|---|
ObservableDictionarystringColor |
DefaultWarningCommentFormatting
Gets the default warning comment formatting.
Declaration
protected FormattingGroup DefaultWarningCommentFormatting { get; }
Property Value
Type | Description |
---|---|
FormattingGroup |
DeletedTQAFormatting
The formatting that will be used when displaying TQA content which has been deleted
Declaration
public IFormattingGroup DeletedTQAFormatting { get; set; }
Property Value
Type | Description |
---|---|
IFormattingGroup |
DeletedTagProperties
The display properties used to paint tags that have been deleted.
Declaration
public ITagPaintingProperties DeletedTagProperties { get; set; }
Property Value
Type | Description |
---|---|
ITagPaintingProperties |
DocumentBackgroundColor
The color used when displaying the background of the document.
Declaration
public Color DocumentBackgroundColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
DocumentTagProperties
The display properties used to paint the document level tags.
Declaration
public ITagPaintingProperties DocumentTagProperties { get; set; }
Property Value
Type | Description |
---|---|
ITagPaintingProperties |
DocumentTextColor
The color used when displaying the text in the document.
Declaration
public Color DocumentTextColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
ErrorCommentFormatting
The formatting that will be used when displaying error level comments.
Declaration
public IFormattingGroup ErrorCommentFormatting { get; set; }
Property Value
Type | Description |
---|---|
IFormattingGroup |
FileTagProperties
The display properties used to paint the file level tags.
Declaration
public ITagPaintingProperties FileTagProperties { get; set; }
Property Value
Type | Description |
---|---|
ITagPaintingProperties |
InformationCommentFormatting
The formatting that will be used when displaying information level comments.
Declaration
public IFormattingGroup InformationCommentFormatting { get; set; }
Property Value
Type | Description |
---|---|
IFormattingGroup |
InsertedRevisionFormatting
The formatting that will be used when displaying revised content that has been inserted.
Declaration
public IFormattingGroup InsertedRevisionFormatting { get; set; }
Property Value
Type | Description |
---|---|
IFormattingGroup |
InsertedTagProperties
The display properties used to paint tags that have been inserted.
Declaration
public ITagPaintingProperties InsertedTagProperties { get; set; }
Property Value
Type | Description |
---|---|
ITagPaintingProperties |
InternalTagProperties
The display properties used to paint internal tags.
Declaration
public ITagPaintingProperties InternalTagProperties { get; set; }
Property Value
Type | Description |
---|---|
ITagPaintingProperties |
LockedContentFormatting
The formatting that will be used when displaying locked content.
Declaration
public IFormattingGroup LockedContentFormatting { get; set; }
Property Value
Type | Description |
---|---|
IFormattingGroup |
MaxFontSize
The maximum font size to adapt fonts to
Declaration
public int MaxFontSize { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
This property has been deprecated by EditControlFontSizeSettings.MaxFontSize.
See Also
MinFontSize
The minimum font size to adapt fonts to
Declaration
public int MinFontSize { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
This property has been deprecated by EditControlFontSizeSettings.MinFontSize.
See Also
ReadOnlySegmentColor
The background color used for read-only segments. Default is Color.Empty
.
Declaration
public Color ReadOnlySegmentColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
RemovedRevisionFormatting
The formatting that will be used when displaying revised content that has been deleted.
Declaration
public IFormattingGroup RemovedRevisionFormatting { get; set; }
Property Value
Type | Description |
---|---|
IFormattingGroup |
SegmentShadingRatio
The ratio that will be used to calculate the row shading color applied to alternating rows.
Declaration
public byte SegmentShadingRatio { get; set; }
Property Value
Type | Description |
---|---|
byte |
SelectedSegmentColor
The background color used when displaying a selected segment.
Declaration
public Color SelectedSegmentColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
ShowTrackedChanges
Declaration
public MarkupDisplayMode ShowTrackedChanges { get; set; }
Property Value
Type | Description |
---|---|
MarkupDisplayMode |
SpellingUnderlineColor
The underline color that will be used when displaying a spelling error marker.
Declaration
public Color SpellingUnderlineColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
TMPlaceableUnderlineColor
The underline color that will be used when displaying a translation memory placeable marker.
Declaration
public Color TMPlaceableUnderlineColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
TagFormatHighlightColor
The background color that will be applied when highlighting tags and formatting in the document for the user to insert.
Declaration
public Color TagFormatHighlightColor { get; set; }
Property Value
Type | Description |
---|---|
Color |
WarningCommentFormatting
The formatting that will be used when displaying warning level comments.
Declaration
public IFormattingGroup WarningCommentFormatting { get; set; }
Property Value
Type | Description |
---|---|
IFormattingGroup |
Methods
ApplyColorRatio(Color, Color, int)
Compares the background and text colors against the ratio and changes the text color if they are too similar.
Declaration
public static Color ApplyColorRatio(Color textColor, Color backColor, int ratio)
Parameters
Type | Name | Description |
---|---|---|
Color | textColor | |
Color | backColor | |
int | ratio |
Returns
Type | Description |
---|---|
Color | The new text color to use |
ClearFormattingListSettings(ISettingsGroup, string)
Removes all saved items belonging to this list from the stored settings group. This is called from SaveFormattingGroupSettings(ISettingsGroup, string, IFormattingGroup) to make sure that the settings being updated are all saved cleanly.
Declaration
protected virtual void ClearFormattingListSettings(ISettingsGroup settingsGroup, string listSettingId)
Parameters
Type | Name | Description |
---|---|---|
ISettingsGroup | settingsGroup | The settings group to remove the settings from. |
string | listSettingId | The ID of the setting to remove. |
FireSettingsUpdated()
Fires the SettingsUpdated event.
Declaration
public void FireSettingsUpdated()
GetSettingFromSettingsGroup<T>(ISettingsGroup, string, T)
Checks whether the setting exists in the settings group, and retrieves its value (if it exists). If it does not exist, the default value is returned instead.
Declaration
protected T GetSettingFromSettingsGroup<T>(ISettingsGroup settingsGroup, string settingName, T defaultValue)
Parameters
Type | Name | Description |
---|---|---|
ISettingsGroup | settingsGroup | The settings group in which the setting should be located. |
string | settingName | The name of the setting to retrieve. |
T | defaultValue | The default value to return if the setting has not been found. |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T | The type of the setting to retrieve. The type must be the same as at the point of save, or it will not be found. See UpdateSettingInSettingsGroup<T>(ISettingsGroup, string, T, T). |
GetStructureInfoColor(string)
Returns the color associated with the structure Id in the settings file or Empty if no color is found
Declaration
public Color GetStructureInfoColor(string structureInfoId)
Parameters
Type | Name | Description |
---|---|---|
string | structureInfoId |
Returns
Type | Description |
---|---|
Color |
LoadFormattingGroupSettings(ISettingsGroup, string, IFormattingGroup, IFormattingGroup)
Loads the settings marked with the settings ID from the settings group and into the provided formatting group. If the settings group does not contain formatting settings then the defaults will be loaded.
Declaration
protected void LoadFormattingGroupSettings(ISettingsGroup settingsGroup, string settingId, IFormattingGroup formattingGroup, IFormattingGroup defaultFormatting)
Parameters
Type | Name | Description |
---|---|---|
ISettingsGroup | settingsGroup | The settings group containing the settings to load. |
string | settingId | The ID of the setting to load from the settings group. |
IFormattingGroup | formattingGroup | The formatting group to load the settings into. This will be cleared before loading. |
IFormattingGroup | defaultFormatting | The default formatting to use if there are no settings matching the settings ID. |
PopulateFromSettingsBundle(ISettingsBundle)
Loads the settings for this object from the settings bundle and populates itself.
Declaration
public virtual void PopulateFromSettingsBundle(ISettingsBundle settingsBundle)
Parameters
Type | Name | Description |
---|---|---|
ISettingsBundle | settingsBundle | The settings bundle to load the settings from. |
SaveFormattingGroupSettings(ISettingsGroup, string, IFormattingGroup)
Saves the formatting settings to the settings group using the provided settings ID as the key.
Declaration
protected void SaveFormattingGroupSettings(ISettingsGroup settingsGroup, string settingId, IFormattingGroup formattingGroup)
Parameters
Type | Name | Description |
---|---|---|
ISettingsGroup | settingsGroup | The settings group to save to. |
string | settingId | The ID to use when saving the settings. |
IFormattingGroup | formattingGroup | The formatting group containing the settings to save. |
SaveToSettingsBundle(ISettingsBundle)
Saves the current state of all members of this object to the provided settings bundle.
Declaration
public virtual void SaveToSettingsBundle(ISettingsBundle settingsBundle)
Parameters
Type | Name | Description |
---|---|---|
ISettingsBundle | settingsBundle | The settings bundle to save the settings to. |
SetAdaptationDefaults()
Sets all of the adaptation settings to their default values.
Declaration
public void SetAdaptationDefaults()
SetColorsDefaults()
Sets all of the colors settings to their default values.
Declaration
public void SetColorsDefaults()
SetRevisionFormattingDefaults()
Sets the edit distance information formatting to their default values.
Declaration
public void SetRevisionFormattingDefaults()
SetStructureInfoColor(string, Color)
Sets the color for the structure info with the id provided.
Declaration
public void SetStructureInfoColor(string structureInfoId, Color color)
Parameters
Type | Name | Description |
---|---|---|
string | structureInfoId | |
Color | color |
SetStructureInfoDefaults()
Sets the structure context colors to their default values
Declaration
public void SetStructureInfoDefaults()
UpdateSettingInSettingsGroup<T>(ISettingsGroup, string, T, T)
Checks whether the setting exists in the settings group. If the setting does exist, then it is updated with the new value; if it does not exist, a new setting is created, but only if the value is not the same as the default value (in which case the call is effectively ignored).
Declaration
protected void UpdateSettingInSettingsGroup<T>(ISettingsGroup settingsGroup, string settingName, T settingValue, T defaultValue)
Parameters
Type | Name | Description |
---|---|---|
ISettingsGroup | settingsGroup | The settings group in which the setting should be saved. |
string | settingName | The name of the setting to save. |
T | settingValue | The value of the setting to save. |
T | defaultValue | The default value of the setting. This is used to prevent creating unnecessary settings when the setting to be created is equal to the default value. This does not affect updating a setting, it only applies when creating a new one. |
Type Parameters
Name | Description |
---|---|
T | The type of the setting to save. The type must be the same as at the point of retrieval, or it will not be returned again correctly. See GetSettingFromSettingsGroup<T>(ISettingsGroup, string, T). |
Events
SettingsUpdated
Event that notifies listeners when these settings have been updated. This event is not fired internally but is instead fired by an external call to FireSettingsUpdated() to reduce the number of reloading required by dependent controls.
Declaration
public event EventHandler<EventArgs> SettingsUpdated
Event Type
Type | Description |
---|---|
EventHandlerEventArgs |