forked from gitextensions/gitextensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpellRichTextBox.cs
More file actions
109 lines (90 loc) · 2.35 KB
/
Copy pathSpellRichTextBox.cs
File metadata and controls
109 lines (90 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
using System;
using System.Windows.Forms;
using System.Drawing;
using System.ComponentModel;
namespace NetSpell.SpellChecker.Controls
{
/// <summary>
/// Summary description for SpellRichTextBox.
/// </summary>
public class SpellRichTextBox : RichTextBox
{
private bool _EnableSpellCheck = true;
private Pen _errorPen = new Pen(Color.Red, 1);
private Spelling _spellChecker;
public SpellRichTextBox()
{
Application.Idle +=new EventHandler(OnIdle);
}
protected override void WndProc(ref Message m)
{
base.WndProc (ref m);
}
protected override void OnTextChanged(EventArgs e)
{
base.OnTextChanged (e);
}
protected override void OnSelectionChanged(EventArgs e)
{
base.OnSelectionChanged (e);
}
protected override void OnMouseDown(MouseEventArgs e)
{
base.OnMouseDown (e);
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint (e);
}
protected override void Dispose(bool disposing)
{
if( disposing )
{
// free pen resources
if(_errorPen != null)
_errorPen.Dispose();
}
base.Dispose( disposing );
}
protected void OnScroll(EventArgs e)
{
}
protected void OnIdle(object sender, EventArgs e)
{
}
/// <summary>
/// The WordDictionary object to use when spell checking
/// </summary>
[Browsable(true)]
[CategoryAttribute("SpellCheck")]
[Description("The Spelling object to use when spell checking")]
public Spelling SpellChecker
{
get {return _spellChecker;}
set {_spellChecker = value;}
}
/// <summary>
/// The color of the wavy underline that marks misspelled words
/// </summary>
[Browsable(true)]
[CategoryAttribute("SpellCheck")]
[Description("The color of the wavy underline that marks misspelled words")]
public Color ErrorColor
{
get {return _errorPen.Color;}
set {_errorPen.Color = value;}
}
/// <summary>
/// Enable As You Type spell checking
/// </summary>
[Browsable(true)]
[DefaultValue(true)]
[CategoryAttribute("SpellCheck")]
[Description("Enable As You Type spell checking")]
public bool EnableSpellCheck
{
get {return _EnableSpellCheck;}
set {_EnableSpellCheck = value;}
}
}
}