G
Guest
I have been testing for a type using code like
if(obj is MyType)
. . . do somethin
Now I want to test for MyType as a return from a metho
Type ReplyType(
return typeof(MyTYpe)
.. . .
if(obj is this.RepyType()
. . . do somethin
The problem is that the 'is' operator complains that it is expecting 'Type'. The return value for RelyType() is Type so I am not sure what it is complaining about or how to fix it. Any ideas? Thank you for your help.
As a bonus I would also like to use the 'as' operator and call a constructor given a type. But I probably can figure out how to do those functions once I have the above figured out
Thanks again
Kevi
if(obj is MyType)
. . . do somethin
Now I want to test for MyType as a return from a metho
Type ReplyType(
return typeof(MyTYpe)
.. . .
if(obj is this.RepyType()
. . . do somethin
The problem is that the 'is' operator complains that it is expecting 'Type'. The return value for RelyType() is Type so I am not sure what it is complaining about or how to fix it. Any ideas? Thank you for your help.
As a bonus I would also like to use the 'as' operator and call a constructor given a type. But I probably can figure out how to do those functions once I have the above figured out
Thanks again
Kevi