private bool RaiseBeforeRecordWrite(object target, int index, ref string state)
        {
            if (_callbackRecord == null) return true;
            object inState = state;
            bool retValue = ChoFuncEx.RunWithIgnoreError(() => _callbackRecord.BeforeRecordWrite(target, index, ref inState), true);
            if (retValue)
                state = inState == null ? null : inState.ToString();

            return retValue;
        }
Beispiel #2
0
 private bool RaiseBeforeRecordWrite(object target, long index, ref string state)
 {
     if (_callbackRecord != null)
     {
         object inState  = state;
         bool   retValue = ChoFuncEx.RunWithIgnoreError(() => _callbackRecord.BeforeRecordWrite(target, index, ref inState), true);
         if (retValue)
         {
             state = inState == null ? null : inState.ToString();
         }
         return(retValue);
     }
     else if (Writer != null)
     {
         object inState  = state;
         bool   retValue = ChoFuncEx.RunWithIgnoreError(() => Writer.RaiseBeforeRecordWrite(target, index, ref inState), true);
         if (retValue)
         {
             state = inState == null ? null : inState.ToString();
         }
         return(retValue);
     }
     return(true);
 }