overriding type information 
Author Message
 overriding type information

Hi All,

I have a question, hope you could help.
Is it possible to override meta information of a type defined by me?
Such that GetType() on an instance of my type would return my own DerivedType subclassed from System.Type.

thanks in advance...
cheers,
Mahesh.



Fri, 19 Nov 2004 21:21:29 GMT  
 overriding type information
Mahesh,

    No, it is not, since the GetType method is not virtual.

    However, if you want to provide dynamic type information, then you can
use the ICustomTypeDescriptor interface to provide that.

    Another alternative if you want to provide your own metadata information
would be to use custom attributes on your class.

    Hope this helps.

--
               - Nicholas Paldino [.NET MVP]


Hi All,

I have a question, hope you could help.
Is it possible to override meta information of a type defined by me?
Such that GetType() on an instance of my type would return my own
DerivedType subclassed from System.Type.

thanks in advance...
cheers,
Mahesh.



Fri, 19 Nov 2004 21:38:45 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Intellisense? override/hide change return type of method

2. Override a method with same parameters types ?

3. overriding virtual function return type or calling convention error

4. Modifying return type when overriding a virtual function in C++ 5

5. Overriding virtual function differ only by return type ..

6. overriding an interface indexer type

7. Bug in C# run-time type information?

8. Type library information

9. No type information at compile time ?

10. Some information is missing or damaged, type libraries and MTS

11. RunTime Type Information

12. Service requiring access to remote type library information

 

 
Powered by phpBB® Forum Software