Code Coverage Statistics for Source File
c:\Tools\SD3\src\Libraries\ICSharpCode.TextEditor\Project\Src\Gui\AbstractMargin.cs
|
Sequence Point Coverage
N/A
0 of 0
|
Branch Coverage
N/A
0 of 0
|
Lines
115
|
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="Mike Krüger" email="mike@icsharpcode.net"/> |
|
5 |
// <version>$Revision: 1965 $</version> |
|
6 |
// </file> |
|
7 |
||
8 |
using System; |
|
9 |
using System.Drawing; |
|
10 |
using System.Windows.Forms; |
|
11 |
||
12 |
using ICSharpCode.TextEditor.Document; |
|
13 |
||
14 |
namespace ICSharpCode.TextEditor |
|
15 |
{ |
|
16 |
public delegate void MarginMouseEventHandler(AbstractMargin sender, Point mousepos, MouseButtons mouseButtons); |
|
17 |
public delegate void MarginPaintEventHandler(AbstractMargin sender, Graphics g, Rectangle rect); |
|
18 |
||
19 |
/// <summary> |
|
20 |
/// This class views the line numbers and folding markers. |
|
21 |
/// </summary> |
|
22 |
public abstract class AbstractMargin |
|
23 |
{ |
|
24 |
Cursor cursor = Cursors.Default; |
|
25 |
||
26 |
[CLSCompliant(false)] |
|
27 |
protected Rectangle drawingPosition = new Rectangle(0, 0, 0, 0); |
|
28 |
[CLSCompliant(false)] |
|
29 |
protected TextArea textArea; |
|
30 |
||
31 |
public Rectangle DrawingPosition { |
|
32 |
get { |
|
33 |
return drawingPosition; |
|
34 |
} |
|
35 |
set { |
|
36 |
drawingPosition = value; |
|
37 |
} |
|
38 |
} |
|
39 |
||
40 |
public TextArea TextArea { |
|
41 |
get { |
|
42 |
return textArea; |
|
43 |
} |
|
44 |
} |
|
45 |
||
46 |
public IDocument Document { |
|
47 |
get { |
|
48 |
return textArea.Document; |
|
49 |
} |
|
50 |
} |
|
51 |
||
52 |
public ITextEditorProperties TextEditorProperties { |
|
53 |
get { |
|
54 |
return textArea.Document.TextEditorProperties; |
|
55 |
} |
|
56 |
} |
|
57 |
||
58 |
public virtual Cursor Cursor { |
|
59 |
get { |
|
60 |
return cursor; |
|
61 |
} |
|
62 |
set { |
|
63 |
cursor = value; |
|
64 |
} |
|
65 |
} |
|
66 |
||
67 |
public virtual Size Size { |
|
68 |
get { |
|
69 |
return new Size(-1, -1); |
|
70 |
} |
|
71 |
} |
|
72 |
||
73 |
public virtual bool IsVisible { |
|
74 |
get { |
|
75 |
return true; |
|
76 |
} |
|
77 |
} |
|
78 |
||
79 |
protected AbstractMargin(TextArea textArea) |
|
80 |
{ |
|
81 |
this.textArea = textArea; |
|
82 |
} |
|
83 |
||
84 |
public virtual void HandleMouseDown(Point mousepos, MouseButtons mouseButtons) |
|
85 |
{ |
|
86 |
if (MouseDown != null) { |
|
87 |
MouseDown(this, mousepos, mouseButtons); |
|
88 |
} |
|
89 |
} |
|
90 |
public virtual void HandleMouseMove(Point mousepos, MouseButtons mouseButtons) |
|
91 |
{ |
|
92 |
if (MouseMove != null) { |
|
93 |
MouseMove(this, mousepos, mouseButtons); |
|
94 |
} |
|
95 |
} |
|
96 |
public virtual void HandleMouseLeave(EventArgs e) |
|
97 |
{ |
|
98 |
if (MouseLeave != null) { |
|
99 |
MouseLeave(this, e); |
|
100 |
} |
|
101 |
} |
|
102 |
||
103 |
public virtual void Paint(Graphics g, Rectangle rect) |
|
104 |
{ |
|
105 |
if (Painted != null) { |
|
106 |
Painted(this, g, rect); |
|
107 |
} |
|
108 |
} |
|
109 |
||
110 |
public event MarginPaintEventHandler Painted; |
|
111 |
public event MarginMouseEventHandler MouseDown; |
|
112 |
public event MarginMouseEventHandler MouseMove; |
|
113 |
public event EventHandler MouseLeave; |
|
114 |
} |
|
115 |
} |