I just checked CF 1.0, 2.0 and 3.5 with Reflector and a Form is definitely
Form->ContainerControl->ScrollableControl->Control->Component->IComponent->IDisposable
"Hilton" <nospam@nospam.com> wrote in message
news:0Bgbj.84380$YL5.41217@newssvr29.news.prodigy.net...
> Chris,
>
> "using" is definitely a 1.0 keyword. I use it all the time; e.g. "using
> (StreamReader sr = new StreamReader (...))". The problem is that Form
> does not implement IDisposable on CF 1. Now if Form all of a sudden does
> implement IDisposable, then that is, by Microsoft's definition, "a
> breaking change" and should not be done.
>
> "(new Form () is IDisposable) return false on CF 1.0, but true on .NET
> (desktop).
>
> Interesting... Seems like a major screwup/oversight by Microsoft. Yes?
>
> That's why I still think that the GC should have: "if o implements
> IDisposable && (!o.Disposed) then o.Dispose" (pseudo code). But I was
> shot down last time and I guess I will be again. So, Form does not
> implement IDisposable on the Compact Framework - solve that. If it is in
> CF 2.0, that is a breaking change and should not be done (according to
> Microsoft).
>
> Comments?
>
> Hilton
>
>
>
> "<ctacke/>" <ctacke[at]opennetcf[dot]com> wrote in message
> news:Ozvrp0JRIHA.2376@TK2MSFTNGP02.phx.gbl...
>> IIRC, The using keyword isn't available until CF 2.0 (Studio '05).
>>
>>
>> --
>>
>> Chris Tacke, eMVP
>> Join the Embedded Developer Community
>>
http://community.opennetcf.com >>
>>
>>
>>
>> "Hilton" <nospam@nospam.com> wrote in message
>> news:hp3bj.32302$JD.4986@newssvr21.news.prodigy.net...
>>> Simon Hart wrote:
>>>> Just ensure you call dispose on your form. It is good practice to use
>>>> the
>>>> using statement. ie: in C#:
>>>>
>>>> using (MyForm form = new MyForm())
>>>> {
>>>> form.ShowDialog();
>>>> }
>>>
>>> This doesn't compile, at least for me anyway (VS2003)
>>>
>>> using (Form form = new Form ())
>>> {}
>>>
>>> Also, "(new Form () is IDisposable)" is false.
>>>
>>> What am I doing wrong?
>>>
>>> Hilton
>>>
>>>
>>
>>
>
>