Hi,
If you have an instance of PropertyT you can do this:
PropertyT instance;
INullableValue var = instance as INullableValue
if ( var != null )
// PropertyT is INullable
If all you have to work are the types (not any instance) then I thikn that
your way is the way to go
cheers,
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"Andrzej Kaczmarczyk" <ak**********@visualsystems.com.pl> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi
How to find out in templated class if a type is implementing an interface.
In particular I want to find out whether the type passed is a
INullableValue
I came up with somethig like this:
class myClass<PropertyT>
{
public DoSomething() {
if ( typeof(PropertyT).GetInterface(typeof(INullableVal ue).ToString())
!= null ) {
// PropertyT is INullable
}
}
}
is there a simpler way?
CUIN Kaczy