Object ProtoTyping like javascript??

  • Thread starter Thread starter Eidolon
  • Start date Start date
E

Eidolon

One feature i love about javascript (as used in IE, i dont know about true
java) is the ability to modify the prototype for an object.
For example i have one line where i wrote essentially:

String.prototype.UpTo(char) = new function {< returns string up to first
occurence of "char">}

And then all string objects from then on have an UpTo method.

Is there any similar functionality or ability to do something like this in
..NET?

Thanks in advance,
- Eidolon
 
You would create a new class that inherits from whatever base class you
want, add a new member to the class and then use that new class going
forward.
 
Alright. Thank you. I knew i could do it that way already, i was just hoping
there was a code-cleaner way. Oh well, i guess ill just wait and say
"someday".
Thanks!
 
Back
Top