Пример #1
0
        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;
            };
        }
Пример #2
0
 public static Scope operator +(Scope scope, Chain code)
 {
     Scope result = new Scope(scope);
     result.AddCode(code);
     return result;
 }
Пример #3
0
 public static Scope operator +(Scope scope1, Scope scope2)
 {
     Scope result = new Scope(scope1);
     result.AddCode(scope2.code);
     return result;
 }
Пример #4
0
 public HandlerBase()
 {
     scope = new Scope(ScopeMethod);
     Enabled = true;
 }