Re: knowing the interfaces that an object implements
- From: "Nick Hall" <nickh@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Apr 2005 12:41:44 +0100
It's not evaluated until runtime - therefore it actually does work. It uses
the IL instruction isinst to make the determination.
Hope this helps,
Nick Hall
"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:MPG.1cd9d4b0b54c9ec798c045@xxxxxxxxxxxxxxxxxxxxxxx
> Jakob Christensen <jch@xxxxxxxxxxxxxxxx> wrote:
>> I am no VB.net expert but I believe the following will work:
>>
>> If TypeOf connection Is IDisposable Then
>> connection.Dispose()
>> End If
>
> I don't believe it should, if Option Strict is on. The compiler still
> doesn't know that connection implements IDisposable - it doesn't
> understand the consequences of the "if" passing.
>
> --
> Jon Skeet - <skeet@xxxxxxxxx>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too
.
- Follow-Ups:
- Re: knowing the interfaces that an object implements
- From: Jon Skeet [C# MVP]
- Re: knowing the interfaces that an object implements
- References:
- knowing the interfaces that an object implements
- From: Sanjay
- Re: knowing the interfaces that an object implements
- From: LOZANO-MORÁN, Gabriel
- Re: knowing the interfaces that an object implements
- From: Jakob Christensen
- Re: knowing the interfaces that an object implements
- From: Tiberiu Covaci[MCAD.NET]
- Re: knowing the interfaces that an object implements
- From: LOZANO-MORÁN, Gabriel
- Re: knowing the interfaces that an object implements
- From: Sanjay
- Re: knowing the interfaces that an object implements
- From: Jakob Christensen
- Re: knowing the interfaces that an object implements
- From: Jon Skeet [C# MVP]
- knowing the interfaces that an object implements
- Prev by Date: Re: Windows 98 slow .Net performance
- Next by Date: 'as' operator
- Previous by thread: Re: knowing the interfaces that an object implements
- Next by thread: Re: knowing the interfaces that an object implements
- Index(es):
Loading