Code Coverage Statistics for Source File
c:\Tools\SD3\src\Libraries\ICSharpCode.TextEditor\Project\Src\Document\MarkerStrategy\TextMarker.cs
|
Sequence Point Coverage
N/A
0 of 0
|
Branch Coverage
N/A
0 of 0
|
Lines
97
|
Highlight:
Uncovered Code
Covered Code
| L | V | Source |
|---|---|---|
1 |
// <file> |
|
2 |
// <copyright see="prj:///doc/copyright.txt"/> |
|
3 |
// <license see="prj:///doc/license.txt"/> |
|
4 |
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/> |
|
5 |
// <version>$Revision: 2140 $</version> |
|
6 |
// </file> |
|
7 |
||
8 |
using System; |
|
9 |
using System.Drawing; |
|
10 |
||
11 |
namespace ICSharpCode.TextEditor.Document |
|
12 |
{ |
|
13 |
public enum TextMarkerType |
|
14 |
{ |
|
15 |
SolidBlock, |
|
16 |
Underlined, |
|
17 |
WaveLine |
|
18 |
} |
|
19 |
||
20 |
/// <summary> |
|
21 |
/// Marks a part of a document. |
|
22 |
/// </summary> |
|
23 |
public class TextMarker : AbstractSegment |
|
24 |
{ |
|
25 |
TextMarkerType textMarkerType; |
|
26 |
Color color; |
|
27 |
Color foreColor; |
|
28 |
string toolTip = null; |
|
29 |
bool overrideForeColor = false; |
|
30 |
||
31 |
public TextMarkerType TextMarkerType { |
|
32 |
get { |
|
33 |
return textMarkerType; |
|
34 |
} |
|
35 |
} |
|
36 |
||
37 |
public Color Color { |
|
38 |
get { |
|
39 |
return color; |
|
40 |
} |
|
41 |
} |
|
42 |
||
43 |
public Color ForeColor { |
|
44 |
get { |
|
45 |
return foreColor; |
|
46 |
} |
|
47 |
} |
|
48 |
||
49 |
public bool OverrideForeColor { |
|
50 |
get { |
|
51 |
return overrideForeColor; |
|
52 |
} |
|
53 |
} |
|
54 |
||
55 |
public string ToolTip { |
|
56 |
get { |
|
57 |
return toolTip; |
|
58 |
} |
|
59 |
set { |
|
60 |
toolTip = value; |
|
61 |
} |
|
62 |
} |
|
63 |
||
64 |
/// <summary> |
|
65 |
/// Gets the last offset that is inside the marker region. |
|
66 |
/// </summary> |
|
67 |
public int EndOffset { |
|
68 |
get { |
|
69 |
return Offset + Length - 1; |
|
70 |
} |
|
71 |
} |
|
72 |
||
73 |
public TextMarker(int offset, int length, TextMarkerType textMarkerType) : this(offset, length, textMarkerType, Color.Red) |
|
74 |
{ |
|
75 |
} |
|
76 |
||
77 |
public TextMarker(int offset, int length, TextMarkerType textMarkerType, Color color) |
|
78 |
{ |
|
79 |
if (length < 1) length = 1; |
|
80 |
this.offset = offset; |
|
81 |
this.length = length; |
|
82 |
this.textMarkerType = textMarkerType; |
|
83 |
this.color = color; |
|
84 |
} |
|
85 |
||
86 |
public TextMarker(int offset, int length, TextMarkerType textMarkerType, Color color, Color foreColor) |
|
87 |
{ |
|
88 |
if (length < 1) length = 1; |
|
89 |
this.offset = offset; |
|
90 |
this.length = length; |
|
91 |
this.textMarkerType = textMarkerType; |
|
92 |
this.color = color; |
|
93 |
this.foreColor = foreColor; |
|
94 |
this.overrideForeColor = true; |
|
95 |
} |
|
96 |
} |
|
97 |
} |