这个类和方法,让人乍一读是读不明白的。不能通过方法名称明白其含义。所以它的方法名称设计是欠考虑。
应该类似于这样:
public static class MyAutoResetEvent { public static AutoResetEvent StartBusy() { return new AutoResetEvent(false); } public static AutoResetEvent StartCompleted() { return new AutoResetEvent(true); } public static bool SetCompleted(this AutoResetEvent EventObject) { return EventObject.Set(); } public bool ResetBusy(this AutoResetEvent EventObject) { return EventObject.Reset(); } }