This repository has been archived by the owner on Feb 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathCodeMirror.cs
195 lines (178 loc) · 7.41 KB
/
CodeMirror.cs
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
using System.ComponentModel;
using System.Xml.Serialization;
namespace DNNConnect.CKEditorProvider.Objects
{
/// <summary>
/// CodeMirror Plugin Options
/// </summary>
public class CodeMirror
{
/// <summary>
/// Initializes a new instance of the <see cref="CodeMirror" /> class.
/// </summary>
public CodeMirror()
{
Theme = "default";
LineNumbers = true;
LineWrapping = true;
MatchBrackets = true;
AutoCloseTags = false;
EnableSearchTools = true;
EnableCodeFolding = true;
EnableCodeFormatting = true;
AutoFormatOnStart = false;
AutoFormatOnUncomment = true;
HighlightActiveLine = true;
HighlightMatches = true;
ShowTabs = false;
ShowFormatButton = true;
ShowCommentButton = true;
ShowUncommentButton = true;
}
/// <summary>
/// Gets or sets the theme.
/// </summary>
/// <value>
/// The theme.
/// </value>
[XmlAttribute("theme")]
[Description("Set this to the theme you wish to use (codemirror themes)")]
public string Theme { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [line numbers].
/// </summary>
/// <value>
/// <c>true</c> if [line numbers]; otherwise, <c>false</c>.
/// </value>
[XmlAttribute("lineNumbers")]
[Description("Whether or not you want to show line numbers")]
public bool LineNumbers { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [line wrapping].
/// </summary>
/// <value>
/// <c>true</c> if [line wrapping]; otherwise, <c>false</c>.
/// </value>
[XmlAttribute("lineWrapping")]
[Description("Whether or not you want to use line wrapping")]
public bool LineWrapping { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [match brackets].
/// </summary>
/// <value>
/// <c>true</c> if [match brackets]; otherwise, <c>false</c>.
/// </value>
[XmlAttribute("matchBrackets")]
[Description("Whether or not you want to highlight matching braces")]
public bool MatchBrackets { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [auto close tags].
/// </summary>
/// <value>
/// <c>true</c> if [auto close tags]; otherwise, <c>false</c>.
/// </value>
[XmlAttribute("autoCloseTags")]
[Description("Whether or not you want tags to automatically close themselves")]
public bool AutoCloseTags { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [enable search tools].
/// </summary>
/// <value>
/// <c>true</c> if [enable search tools]; otherwise, <c>false</c>.
/// </value>
[XmlAttribute("enableSearchTools")]
[Description("Whether or not to enable search tools, CTRL+F (Find), CTRL+SHIFT+F (Replace), CTRL+SHIFT+R (Replace All), CTRL+G (Find Next), CTRL+SHIFT+G (Find Previous)")]
public bool EnableSearchTools { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [enable code folding].
/// </summary>
/// <value>
/// <c>true</c> if [enable code folding]; otherwise, <c>false</c>.
/// </value>
[XmlAttribute("enableCodeFolding")]
[Description("Whether or not you wish to enable code folding (requires 'lineNumbers' to be set to 'true')")]
public bool EnableCodeFolding { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [enable code formatting].
/// </summary>
/// <value>
/// <c>true</c> if [enable code formatting]; otherwise, <c>false</c>.
/// </value>
[XmlAttribute("enableCodeFormatting")]
[Description("Whether or not to enable code formatting")]
public bool EnableCodeFormatting { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [auto format on start].
/// </summary>
/// <value>
/// <c>true</c> if [auto format on start]; otherwise, <c>false</c>.
/// </value>
[XmlAttribute("autoFormatOnStart")]
[Description("Whether or not to automatically format code should be done every time the source view is opened")]
public bool AutoFormatOnStart { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [auto format on uncomment].
/// </summary>
/// <value>
/// <c>true</c> if [auto format on uncomment]; otherwise, <c>false</c>.
/// </value>
[XmlAttribute("autoFormatOnUncomment")]
[Description("Whether or not to automatically format code which has just been uncommented")]
public bool AutoFormatOnUncomment { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [highlight active line].
/// </summary>
/// <value>
/// <c>true</c> if [highlight active line]; otherwise, <c>false</c>.
/// </value>
[XmlAttribute("highlightActiveLine")]
[Description("Whether or not to highlight the currently active line")]
public bool HighlightActiveLine { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [highlight matches].
/// </summary>
/// <value>
/// <c>true</c> if [highlight matches]; otherwise, <c>false</c>.
/// </value>
[XmlAttribute("highlightMatches")]
[Description("Whether or not to highlight all matches of current word/selection")]
public bool HighlightMatches { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [show tabs].
/// </summary>
/// <value>
/// <c>true</c> if [show tabs]; otherwise, <c>false</c>.
/// </value>
[XmlAttribute("showTabs")]
[Description("Whether or not to display tabs")]
public bool ShowTabs { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [show format button].
/// </summary>
/// <value>
/// <c>true</c> if [show format button]; otherwise, <c>false</c>.
/// </value>
[XmlAttribute("showFormatButton")]
[Description("Whether or not to show the format button on the toolbar")]
public bool ShowFormatButton { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [show comment button].
/// </summary>
/// <value>
/// <c>true</c> if [show comment button]; otherwise, <c>false</c>.
/// </value>
[XmlAttribute("showCommentButton")]
[Description("Whether or not to show the comment button on the toolbar")]
public bool ShowCommentButton { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [show uncomment button].
/// </summary>
/// <value>
/// <c>true</c> if [show uncomment button]; otherwise, <c>false</c>.
/// </value>
[XmlAttribute("showUncommentButton")]
[Description("Whether or not to show the uncomment button on the toolbar")]
public bool ShowUncommentButton { get; set; }
}
}