/// <summary> /// Same as Enter, but if called after Enter (or self), return fake handler. /// This allows to check one flag many times, with only one reset at last dispose. /// </summary> /// <returns></returns> public ActionWrapperHandler Join(T param) { FlagActionWrapper <T> f; if (flag) { f = new FlagActionWrapper <T>((p) => { }); } else { f = this; } return(new ActionWrapperHandler(f)); }
public ActionWrapperHandler(FlagActionWrapper <T> owner) { this.owner = owner; owner.flag = true; }