Scope.Chain ScopeMethod(Scope.Chain code) { if (inFlag || !Enabled) return (p) => { code(null); return null; }; return (p) => { inFlag = true; try { OnEnterScope(EventArgs.Empty); this.code = code; Call(); } finally { OnLeaveScope(EventArgs.Empty); inFlag = false; } return null; }; }
public static Scope operator +(Scope scope, Chain code) { Scope result = new Scope(scope); result.AddCode(code); return result; }
public static Scope operator +(Scope scope1, Scope scope2) { Scope result = new Scope(scope1); result.AddCode(scope2.code); return result; }
public HandlerBase() { scope = new Scope(ScopeMethod); Enabled = true; }