"Dan" <Da*@discussions.microsoft.com> wrote in message
news:45**********************************@microsof t.com...
Hi everybody,
is it possible to add new keywords in c#, in order to improve
functionality?
just as
(using IDisposableImplementer = new IDisposableImplementer())
{
// use the IDisposableImplementer
}
first thing that pops in my mind - even though may seem trivial - is for
automatically setting the cursor to busy before a lengthy operation and
resetting to default afterwards; just using a construct similar to
"using".
You can't add keywords, no, but you can abuse using to do this(although I'm
not sure if it is a good idea or not...)
Simply create a disposable class that sets the cursor to busy in its
constructor(you'd have to pass the form you want to change the cursor on of
course) and unsets it in its Dispose method. Then when you use it in a using
block you get the effect you want.