![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#11
| |||
| |||
|
|
Well you have to believe the runtime. I can only conclude that I'm looking at the wrong 1.0 binary (or at least not the one your system is using). What version of 1.0 are you running? -- Chris Tacke, eMVP Join the Embedded Developer Community http://community.opennetcf.com "Hilton" <nospam (AT) nospam (DOT) com> wrote in message news:sunbj.790$6%.199 (AT) nlpi061 (DOT) nbdc.sbc.com... To follow-up my own post: When I run (FormDispose.exe) with the line: "MessageBox.Show (((new Form () is IDisposable).ToString()));" it returns *false*. This is using CF 1. Then I add the file FormDispose.exe.config so that FormDispose uses CF 2 and guess what? Yip, it returns *true*. Believe it, or not... Hilton "Hilton" <nospam (AT) nospam (DOT) com> wrote in message news:IRmbj.784$6%.53 (AT) nlpi061 (DOT) nbdc.sbc.com... Chris, I just checked CF 1.0, 2.0 and 3.5 with Reflector and a Form is definitely derived from IDisposable in all three. Form->ContainerControl->ScrollableControl->Control->Component->IComponent->IDisposable OK, so: Q1: Why does: using (Form form = new Form()) {} give the following compiler error: c:\test\FormDispose\Form1.cs(32): Cannot implicitly convert type 'System.Windows.Forms.Form' to 'System.IDisposable' ...and.. Q2: Why does: "(new Form () is IDisposable)" return false? Q1 is a compile time check, Q2 is a run-time and they're consistent. Hilton |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |