ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
csharp.php
Go to the documentation of this file.
1 <?php
2 /*************************************************************************************
3  * csharp.php
4  * ----------
5  * Author: Alan Juden (alan@judenware.org)
6  * Revised by: Michael Mol (mikemol@gmail.com)
7  * Copyright: (c) 2004 Alan Juden, Nigel McNie (http://qbnz.com/highlighter/)
8  * Release Version: 1.0.8.12
9  * Date Started: 2004/06/04
10  *
11  * C# language file for GeSHi.
12  *
13  * CHANGES
14  * -------
15  * 2012/06/18 (1.0.8.11)
16  * - Added missing keywords (Christian Stelzmann)
17  * 2009/04/03 (1.0.8.6)
18  * - Added missing keywords identified by Rosetta Code users.
19  * 2008/05/25 (1.0.7.22)
20  * - Added highlighting of using and namespace directives as non-OOP
21  * 2005/01/05 (1.0.1)
22  * - Used hardquote support for @"..." strings (Cliff Stanford)
23  * 2004/11/27 (1.0.0)
24  * - Initial release
25  *
26  * TODO (updated 2004/11/27)
27  * -------------------------
28  *
29  *************************************************************************************
30  *
31  * This file is part of GeSHi.
32  *
33  * GeSHi is free software; you can redistribute it and/or modify
34  * it under the terms of the GNU General Public License as published by
35  * the Free Software Foundation; either version 2 of the License, or
36  * (at your option) any later version.
37  *
38  * GeSHi is distributed in the hope that it will be useful,
39  * but WITHOUT ANY WARRANTY; without even the implied warranty of
40  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41  * GNU General Public License for more details.
42  *
43  * You should have received a copy of the GNU General Public License
44  * along with GeSHi; if not, write to the Free Software
45  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
46  *
47  ************************************************************************************/
48 
50  'LANG_NAME' => 'C#',
51  'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
52  'COMMENT_MULTI' => array('/*' => '*/'),
53  'COMMENT_REGEXP' => array(
54  //Using and Namespace directives (basic support)
55  //Please note that the alias syntax for using is not supported
56  3 => '/(?:(?<=using[\\n\\s])|(?<=namespace[\\n\\s]))[\\n\\s]*([a-zA-Z0-9_]+\\.)*[a-zA-Z0-9_]+[\n\s]*(?=[;=])/i'),
57  'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
58  'QUOTEMARKS' => array("'", '"'),
59  'HARDQUOTE' => array('@"', '"'),
60  'HARDESCAPE' => array('"'),
61  'HARDCHAR' => '"',
62  'ESCAPE_CHAR' => '\\',
63  'KEYWORDS' => array(
64  1 => array(
65  'abstract', 'add', 'as', 'base', 'break', 'by', 'case', 'catch', 'const', 'continue',
66  'default', 'do', 'else', 'event', 'explicit', 'extern', 'false',
67  'finally', 'fixed', 'for', 'foreach', 'from', 'get', 'goto', 'group', 'if',
68  'implicit', 'in', 'into', 'internal', 'join', 'lock', 'namespace', 'null',
69  'operator', 'out', 'override', 'params', 'partial', 'private',
70  'protected', 'public', 'readonly', 'remove', 'ref', 'return', 'sealed',
71  'select', 'set', 'stackalloc', 'static', 'switch', 'this', 'throw', 'true',
72  'try', 'unsafe', 'using', 'var', 'value', 'virtual', 'volatile', 'where',
73  'while', 'yield'
74  ),
75  2 => array(
76  '#elif', '#endif', '#endregion', '#else', '#error', '#define', '#if',
77  '#line', '#region', '#undef', '#warning'
78  ),
79  3 => array(
80  'checked', 'is', 'new', 'sizeof', 'typeof', 'unchecked'
81  ),
82  4 => array(
83  'bool', 'byte', 'char', 'class', 'decimal', 'delegate', 'double',
84  'dynamic', 'enum', 'float', 'int', 'interface', 'long', 'object', 'sbyte',
85  'short', 'string', 'struct', 'uint', 'ulong', 'ushort', 'void'
86  ),
87  5 => array(
88  'Microsoft.Win32',
89  'System',
90  'System.CodeDOM',
91  'System.CodeDOM.Compiler',
92  'System.Collections',
93  'System.Collections.Bases',
94  'System.ComponentModel',
95  'System.ComponentModel.Design',
96  'System.ComponentModel.Design.CodeModel',
97  'System.Configuration',
98  'System.Configuration.Assemblies',
99  'System.Configuration.Core',
100  'System.Configuration.Install',
101  'System.Configuration.Interceptors',
102  'System.Configuration.Schema',
103  'System.Configuration.Web',
104  'System.Core',
105  'System.Data',
106  'System.Data.ADO',
107  'System.Data.Design',
108  'System.Data.Internal',
109  'System.Data.SQL',
110  'System.Data.SQLTypes',
111  'System.Data.XML',
112  'System.Data.XML.DOM',
113  'System.Data.XML.XPath',
114  'System.Data.XML.XSLT',
115  'System.Diagnostics',
116  'System.Diagnostics.SymbolStore',
117  'System.DirectoryServices',
118  'System.Drawing',
119  'System.Drawing.Design',
120  'System.Drawing.Drawing2D',
121  'System.Drawing.Imaging',
122  'System.Drawing.Printing',
123  'System.Drawing.Text',
124  'System.Globalization',
125  'System.IO',
126  'System.IO.IsolatedStorage',
127  'System.Messaging',
128  'System.Net',
129  'System.Net.Sockets',
130  'System.NewXml',
131  'System.NewXml.XPath',
132  'System.NewXml.Xsl',
133  'System.Reflection',
134  'System.Reflection.Emit',
135  'System.Resources',
136  'System.Runtime.InteropServices',
137  'System.Runtime.InteropServices.Expando',
138  'System.Runtime.Remoting',
139  'System.Runtime.Serialization',
140  'System.Runtime.Serialization.Formatters',
141  'System.Runtime.Serialization.Formatters.Binary',
142  'System.Security',
143  'System.Security.Cryptography',
144  'System.Security.Cryptography.X509Certificates',
145  'System.Security.Permissions',
146  'System.Security.Policy',
147  'System.Security.Principal',
148  'System.ServiceProcess',
149  'System.Text',
150  'System.Text.RegularExpressions',
151  'System.Threading',
152  'System.Timers',
153  'System.Web',
154  'System.Web.Caching',
155  'System.Web.Configuration',
156  'System.Web.Security',
157  'System.Web.Services',
158  'System.Web.Services.Description',
159  'System.Web.Services.Discovery',
160  'System.Web.Services.Protocols',
161  'System.Web.UI',
162  'System.Web.UI.Design',
163  'System.Web.UI.Design.WebControls',
164  'System.Web.UI.Design.WebControls.ListControls',
165  'System.Web.UI.HtmlControls',
166  'System.Web.UI.WebControls',
167  'System.WinForms',
168  'System.WinForms.ComponentModel',
169  'System.WinForms.Design',
170  'System.Xml',
171  'System.Xml.Serialization',
172  'System.Xml.Serialization.Code',
173  'System.Xml.Serialization.Schema'
174  ),
175  ),
176  'SYMBOLS' => array(
177  '+', '-', '*', '?', '=', '/', '%', '&', '>', '<', '^', '!', ':', ';',
178  '(', ')', '{', '}', '[', ']', '|', '.'
179  ),
180  'CASE_SENSITIVE' => array(
181  GESHI_COMMENTS => false,
182  1 => false,
183  2 => false,
184  3 => false,
185  4 => false,
186  5 => false,
187  ),
188  'STYLES' => array(
189  'KEYWORDS' => array(
190  1 => 'color: #0600FF; font-weight: bold;',
191  2 => 'color: #FF8000; font-weight: bold;',
192  3 => 'color: #008000;',
193  4 => 'color: #6666cc; font-weight: bold;',
194  5 => 'color: #000000;'
195  ),
196  'COMMENTS' => array(
197  1 => 'color: #008080; font-style: italic;',
198  2 => 'color: #008080;',
199  3 => 'color: #008080;',
200  'MULTI' => 'color: #008080; font-style: italic;'
201  ),
202  'ESCAPE_CHAR' => array(
203  0 => 'color: #008080; font-weight: bold;',
204  'HARD' => 'color: #008080; font-weight: bold;'
205  ),
206  'BRACKETS' => array(
207  0 => 'color: #008000;'
208  ),
209  'STRINGS' => array(
210  0 => 'color: #666666;',
211  'HARD' => 'color: #666666;'
212  ),
213  'NUMBERS' => array(
214  0 => 'color: #FF0000;'
215  ),
216  'METHODS' => array(
217  1 => 'color: #0000FF;',
218  2 => 'color: #0000FF;'
219  ),
220  'SYMBOLS' => array(
221  0 => 'color: #008000;'
222  ),
223  'REGEXPS' => array(
224  ),
225  'SCRIPT' => array(
226  )
227  ),
228  'URLS' => array(
229  1 => '',
230  2 => '',
231  3 => 'http://www.google.com/search?q={FNAMEL}+msdn.microsoft.com',
232  4 => '',
233  5 => ''
234  ),
235  'OOLANG' => true,
236  'OBJECT_SPLITTERS' => array(
237  1 => '.',
238  2 => '::'
239  ),
240  'REGEXPS' => array(
241  ),
242  'STRICT_MODE_APPLIES' => GESHI_NEVER,
243  'SCRIPT_DELIMITERS' => array(
244  ),
245  'HIGHLIGHT_STRICT_BLOCK' => array(
246  ),
247  'TAB_WIDTH' => 4,
248  'PARSER_CONTROL' => array(
249  'KEYWORDS' => array(
250  'DISALLOWED_BEFORE' => "(?<![a-zA-Z0-9\$_\|\#>|^])",
251  'DISALLOWED_AFTER' => "(?![a-zA-Z0-9_%\\-])"
252  )
253  )
254 );
const GESHI_COMMENTS
Used in language files to mark comments.
Definition: geshi.php:150
$language_data
Definition: csharp.php:49
Create styles array
The data for the language used.
const GESHI_NEVER
#+ private
Definition: geshi.php:124
const GESHI_CAPS_NO_CHANGE
Lowercase keywords found.
Definition: geshi.php:95