Re: Inheritable Static methods

Tech-Archive recommends: Fix windows errors by optimizing your registry



On May 26, 11:37 pm, "Peter Duniho" <NpOeStPe...@xxxxxxxxxxxxxxxx>
wrote:
On Mon, 26 May 2008 17:31:14 -0700, d-42 <db.pors...@xxxxxxxxx> wrote:

Frankly, your use case here is a bit bizarre IMHO (and I mean that in a
good way :) ). I mean, usually people come here complaining that they
can't have virtual static methods because they want to implement something
that's actually impossible to implement. But here, you've got a perfectly
good alternative syntax that does _exactly_ the same thing.

I don't see the problem.

Pete

As I replied to Jon Skeet, I can live with using typeof(x).Name. I
would have liked to have made it a simple static property of the class
for aesthetics, but its not really an issue if I can't.

I just wanted to ensure that I truly couldn't do it, and understand
why, because I was surprised to have stumbled into something that
seemed so simple that I couldn't for the life of me figure out how to
do.

Its not often I find myself facing a situation where to get the effect
I want I'd have to write dozens of almost identical functions and not
be able to refactor it.

Thanks for your insights.

-cheers,
Dave
.