pascalabcnet/ICSharpCode.TextEditorLinux/Src/Document/MarkerStrategy/TextMarker.cs
Mikhalkovich Stanislav 3072383106 Для Linux-версии исправлен DockContent, редактор (показ всплывающего окна)
Сделан новый проект VisualPABCLinux
И пришлось склонировать PluginsSupport, поскольку он вносит зависимость по редактору
Компоненты WeifenLuo для Linux надо после перекомпиляции скопировать в Libraries - подшить их к основному проекту просто не получилось
2022-06-30 09:47:11 +03:00

111 lines
2.1 KiB
C#

// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
// <version>$Revision: 2140 $</version>
// </file>
using System;
using System.Drawing;
namespace ICSharpCode.TextEditor.Document
{
public enum TextMarkerType
{
SolidBlock,
Underlined,
WaveLine,
Cant
}
/// <summary>
/// Marks a part of a document.
/// </summary>
public class TextMarker : AbstractSegment
{
TextMarkerType textMarkerType;
Color color;
Color foreColor;
string toolTip = null;
bool overrideForeColor = false;
bool wholeLine = false;
public TextMarkerType TextMarkerType {
get {
return textMarkerType;
}
}
public bool WholeLine
{
get
{
return WholeLine;
}
set
{
wholeLine = value;
}
}
public Color Color {
get {
return color;
}
}
public Color ForeColor {
get {
return foreColor;
}
}
public bool OverrideForeColor {
get {
return overrideForeColor;
}
}
public string ToolTip {
get {
return toolTip;
}
set {
toolTip = value;
}
}
/// <summary>
/// Gets the last offset that is inside the marker region.
/// </summary>
public int EndOffset {
get {
return Offset + Length - 1;
}
}
public TextMarker(int offset, int length, TextMarkerType textMarkerType) : this(offset, length, textMarkerType, Color.Red)
{
}
public TextMarker(int offset, int length, TextMarkerType textMarkerType, Color color)
{
if (length < 1) length = 1;
this.offset = offset;
this.length = length;
this.textMarkerType = textMarkerType;
this.color = color;
}
public TextMarker(int offset, int length, TextMarkerType textMarkerType, Color color, Color foreColor)
{
if (length < 1) length = 1;
this.offset = offset;
this.length = length;
this.textMarkerType = textMarkerType;
this.color = color;
this.foreColor = foreColor;
this.overrideForeColor = true;
}
}
}