public static AutoResetEvent CreateAutoResetEvent() { AutoResetEvent waitHandle = new AutoResetEvent(false); #if (WindowsCE) ReplaceEventHandle(waitHandle, false, false); #endif return waitHandle; }