|
 |
Warp wrote:
>
> I see no relevant difference to making a function so that you can write
> "DrawButton(g, rcArea, caption)".
>
Except that in C# everything is defined in a class. So, if the function
is part of a library, you'd have to either define static methods or
instance methods. The Graphics class is sealed, so there's no means of
defining a sub class, such as GraphicEx ...so your choices are define a
bunch of static methods, or define a class whose constructor takes a
pointer to a Graphics object, and offers the extended functions.
C# 3.0 offers the extension methods to get around this. It may seem like
a pointless feature to you, but for some it is a minor convenience.
--
~Mike
Post a reply to this message
|
 |