示例#1
0
        private bool RaiseRecordFieldLoadError(object target, long index, string propName, ref object value, Exception ex)
        {
            bool   retValue = false;
            object state    = value;

            if (Reader != null && Reader.HasRecordFieldLoadErrorSubscribed)
            {
                retValue = ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseRecordFieldLoadError(target, index, propName, ref state, ex), false);
                if (retValue)
                {
                    value = state;
                }
            }
            else if (target is IChoNotifyRecordFieldRead)
            {
                retValue = ChoFuncEx.RunWithIgnoreError(() => ((IChoNotifyRecordFieldRead)target).RecordFieldLoadError(target, index, propName, ref state, ex), false);
                if (retValue)
                {
                    value = state;
                }
            }
            else if (_callbackRecordFieldRead != null)
            {
                retValue = ChoFuncEx.RunWithIgnoreError(() => _callbackRecordFieldRead.RecordFieldLoadError(target, index, propName, ref state, ex), false);
                if (retValue)
                {
                    value = state;
                }
            }
            return(retValue);
        }
示例#2
0
        private bool RaiseRecordFieldLoadError(object target, long index, string propName, object value, Exception ex)
        {
            if (Configuration.NotifyRecordFieldReadObject != null)
            {
                object state    = value;
                bool   retValue = ChoFuncEx.RunWithIgnoreError(() => Configuration.NotifyRecordFieldReadObject.RecordFieldLoadError(target, index, propName, ref value, ex), false);

                if (retValue)
                {
                    value = state;
                }

                return(retValue);
            }
            else if (Reader != null)
            {
                object state    = value;
                bool   retValue = ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseRecordFieldLoadError(target, index, propName, ref value, ex), false);

                if (retValue)
                {
                    value = state;
                }

                return(retValue);
            }
            return(true);
        }
 private bool RaiseRecordFieldLoadError(object target, long index, string propName, object value, Exception ex)
 {
     if (_callbackRecord != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => _callbackRecord.RecordFieldLoadError(target, index, propName, value, ex), false));
     }
     else if (Reader != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseRecordFieldLoadError(target, index, propName, value, ex), false));
     }
     return(true);
 }
 private bool RaiseRecordFieldLoadError(object target, long index, string propName, object value, Exception ex)
 {
     if (Configuration.NotifyRecordReadObject != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Configuration.NotifyRecordReadObject.RecordFieldLoadError(target, index, propName, value, ex), true));
     }
     else if (Reader != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseRecordFieldLoadError(target, index, propName, value, ex), true));
     }
     return(true);
 }