Re: Making static class ToString() not possible, why?
- From: Zytan <zytanlithium@xxxxxxxxx>
- Date: 19 Apr 2007 17:07:25 -0700
Yes, of course, those are OOP things, and a static class is basically
just a unit of functions. I don't want to inherit anything. I just
want a ToString() method that is automatically invoked when I append
it to a string. But, for that, I want the inherited method, don't I?
But what's the "it" here? You say you want it to be automatically
invoked when you append "it" to a string, but with a static class there
*isn't* anything to append. That's the problem.
I hope I can possibly explain why I wanted to do such a crazy thing,
it's because there was only one instance of this struct. And it had a
ToString() to easily print out all of its data. So, I made a static
class out of it, instead, which forces only one 'copy' of it. But, I
still wanted a convenient function to print out all of its data. But,
yes, how can object.ToString be invoke on a static class? Thus, I
need to merely make my own function named something else othere than
ToString and use it, instead.
Zytan
.
- Follow-Ups:
- Re: Making static class ToString() not possible, why?
- From: Peter Duniho
- Re: Making static class ToString() not possible, why?
- References:
- Making static class ToString() not possible, why?
- From: Zytan
- Re: Making static class ToString() not possible, why?
- From: Jon Skeet [C# MVP]
- Re: Making static class ToString() not possible, why?
- From: Zytan
- Re: Making static class ToString() not possible, why?
- From: Jon Skeet [C# MVP]
- Making static class ToString() not possible, why?
- Prev by Date: Multiple images in a PictureBox Control
- Next by Date: Why doesn't C# allow incremental compilation like Java?
- Previous by thread: Re: Making static class ToString() not possible, why?
- Next by thread: Re: Making static class ToString() not possible, why?
- Index(es):
Relevant Pages
|