\lstdefinelanguage{CSharp}
{
morecomment = [l]{//},
morecomment = [l]{///},
morecomment = [s]{/*}{*/},
morestring=[b]",
sensitive = true,
morekeywords = {abstract, event, new, struct,
as, explicit, null, switch,
base, extern, object, this,
bool, false, operator, throw,
break, finally, out, true,
byte, fixed, override, try,
case, float, params, typeof,
catch, for, private, uint,
char, foreach, protected, ulong,
checked, goto, public, unchecked,
class, if, readonly, unsafe,
const, implicit, ref, ushort,
continue, in, return, using,
decimal, int, sbyte, virtual,
default, interface, sealed, volatile,
delegate, internal, short, void,
do, is, sizeof, while,
double, lock, stackalloc,
else, long, static,
enum, namespace, string}
}
As I said pretty simple. Also look all those keywords! I'm embarrased to say I don't know some of them! Volatile? What's that? And stackalloc? I'll have to do some reading!
2 comments:
Hey Daniel, thanks for posting that code. I'm writing a PhD thesis in LaTex and using C# code. Cheers!
Nick
(Aust. PhD Student, Uni Melbourne)
You forgot LINQ keywords. Technically part of C# as well:
http://msdn.microsoft.com/en-us/library/bb310804.aspx
Some more new keywords for you to look up! :)
Otherwise, nice work. I'm using it for my report!
Post a Comment