Пример #1
0
        private bool RaiseBeforeRecordFieldLoad(object target, long index, string propName, ref object value)
        {
            if (Configuration.NotifyRecordFieldReadObject != null)
            {
                object state    = value;
                bool   retValue = ChoFuncEx.RunWithIgnoreError(() => Configuration.NotifyRecordFieldReadObject.BeforeRecordFieldLoad(target, index, propName, ref state), true);

                if (retValue)
                {
                    value = state;
                }

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

                if (retValue)
                {
                    value = state;
                }

                return(retValue);
            }
            return(true);
        }
Пример #2
0
        private bool RaiseBeforeRecordFieldLoad(object target, long index, string propName, ref object value)
        {
            if (_callbackFieldRecord != null)
            {
                object state    = value;
                bool   retValue = ChoFuncEx.RunWithIgnoreError(() => _callbackFieldRecord.BeforeRecordFieldLoad(target, index, propName, ref state), true);

                if (retValue)
                {
                    value = state;
                }

                return(retValue);
            }
            else if (target is IChoNotifyRecordFieldRead)
            {
                object state    = value;
                bool   retValue = ChoFuncEx.RunWithIgnoreError(() => ((IChoNotifyRecordFieldRead)target).BeforeRecordFieldLoad(target, index, propName, ref state), true);

                if (retValue)
                {
                    value = state;
                }

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

                if (retValue)
                {
                    value = state;
                }

                return(retValue);
            }
            return(true);
        }