This is more a question out of interest than an issue really. In the full framework and in CF 2.0 the WaitHandle hierarchy implements IDisposable but in CF 1.0 they did not. Was WaitHandles implemented different in the old Compact Framework
You are right that in CF 1.0 the WaitHandle class did not implement IDisposable, but in 2.0 (to maintain compatibility to the desktop behavior) of this class we decided to have it implement IDisposable.
When you mean was it implemented differently (I am assuming if you are asking if the underlying behavior changed) well since it now implements the IDisposable interface, pretty much we added the implementation of the IDispose.Dispose as required by the interface in V2.0.
Thanks for the answer. The question is purely academic and referring back to the original design decision to not have the CF 1.0 implementation implement IDisposable as was the case for the full framework.
Just some background what brought the question to mind, in 1.1 when implementing a WaitHandle you'd override the virtual Dispose(bool) method and trust the base to invoke your clean up code. For a class like the WaitHandle which typically would wrap some native resource it felt counter intuitive to not have the same pattern and interface implementations in the old Compact Framework.
Thanks again.
ie. using System; using System.Threading;
public class MyWaitHandle : WaitHandle { public static void Main() { using(MyWaitHandle mwh = new MyWaitHandle()) { mwh.WaitOne(); }
WaitHandle (IDisposable)
ImereJ
You are right that in CF 1.0 the WaitHandle class did not implement IDisposable, but in 2.0 (to maintain compatibility to the desktop behavior) of this class we decided to have it implement IDisposable.
When you mean was it implemented differently (I am assuming if you are asking if the underlying behavior changed) well since it now implements the IDisposable interface, pretty much we added the implementation of the IDispose.Dispose as required by the interface in V2.0.
ZacharyK
Just some background what brought the question to mind, in 1.1 when implementing a WaitHandle you'd override the virtual Dispose(bool) method and trust the base to invoke your clean up code. For a class like the WaitHandle which typically would wrap some native resource it felt counter intuitive to not have the same pattern and interface implementations in the old Compact Framework.
Thanks again.
ie.
using System;
using System.Threading;
public class MyWaitHandle : WaitHandle
{
public static void Main()
{
using(MyWaitHandle mwh = new MyWaitHandle())
{
mwh.WaitOne();
}
Console.ReadLine();
}
public override bool WaitOne()
{
return true;
}
protected override void Dispose(bool disposing)
{
Console.WriteLine("disposing - {0}",disposing);
}
}
MAtkins
Not implementing IDisposable on WaitHandle in V1 was more of an omission on our part rather than a design decision and we decided to fix this in V2.
Thanks.
Gildas Garcia