Re: Knowing an object implements an Interface
- From: "Carl Daniel [VC++ MVP]" <cpdaniel_remove_this_and_nospam@xxxxxxxxxxxxxxx>
- Date: Thu, 29 Jun 2006 22:28:17 -0700
Ron M. Newman wrote:
Hi,
Is there a quick way to know if a given object implements IComparable?
(without casting or anything like that). Something that uses
reflection?
casting under the CLR uses reflection (well, type meta-data, not the
relfection API per-se), so you're tilting against windmills trying to do it
"without casting or anything like that". Just use the 'is' operator in C#
(trycast in IL).
-cd
.
- References:
- Knowing an object implements an Interface
- From: Ron M. Newman
- Knowing an object implements an Interface
- Prev by Date: RE: WebBrowser access to binary content
- Next by Date: PC login name
- Previous by thread: Re: Knowing an object implements an Interface
- Next by thread: creating a type from a string
- Index(es):
Relevant Pages
|