private bool RaiseRecordLoadError(object target, Tuple <long, string> pair, Exception ex)
 {
     if (_callbackRecord != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => _callbackRecord.RecordLoadError(target, pair.Item1, pair.Item2, ex), false));
     }
     else if (Reader != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseRecordLoadError(target, pair.Item1, pair.Item2, ex), false));
     }
     return(true);
 }
 private bool RaiseRecordWriteError(object target, long index, string state, Exception ex)
 {
     if (_callbackRecord != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => _callbackRecord.RecordWriteError(target, index, state, ex), false));
     }
     else if (Writer != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Writer.RaiseRecordWriteError(target, index, state, ex), false));
     }
     return(true);
 }
 private bool RaiseBeginLoad(object state)
 {
     if (_callbackRecord != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => _callbackRecord.BeginLoad(state), true));
     }
     else if (Reader != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseBeginLoad(state), true));
     }
     return(true);
 }
 private bool RaiseAfterRecordWrite(object target, long index, string state)
 {
     if (_callbackRecord != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => _callbackRecord.AfterRecordWrite(target, index, state), true));
     }
     else if (Writer != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Writer.RaiseAfterRecordWrite(target, index, state), true));
     }
     return(true);
 }
Example #5
0
 private bool RaiseAfterRecordLoad(object target, Tuple <long, string> pair)
 {
     if (_callbackRecord != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => _callbackRecord.AfterRecordLoad(target, pair.Item1, pair.Item2), true));
     }
     else if (Reader != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseAfterRecordLoad(target, pair.Item1, pair.Item2), true));
     }
     return(true);
 }
 private bool RaiseRecordFieldWriteError(object target, long index, string propName, object value, Exception ex)
 {
     if (Configuration.NotifyRecordFieldWriteObject != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Configuration.NotifyRecordFieldWriteObject.RecordFieldWriteError(target, index, propName, value, ex), false));
     }
     else if (Writer != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Writer.RaiseRecordFieldWriteError(target, index, propName, value, ex), false));
     }
     return(true);
 }
 private bool RaiseAfterRecordFieldLoad(object target, long index, string propName, object value)
 {
     if (_callbackRecord != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => _callbackRecord.AfterRecordFieldLoad(target, index, propName, value), true));
     }
     else if (Reader != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseAfterRecordFieldLoad(target, index, propName, value), true));
     }
     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 RaiseBeginWrite(object state)
 {
     if (Configuration.NotifyFileWriteObject != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Configuration.NotifyFileWriteObject.BeginWrite(state), true));
     }
     else if (Writer != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Writer.RaiseBeginWrite(state), true));
     }
     return(true);
 }
Example #10
0
 private bool RaiseRecordLoadError(object target, Tuple <long, string> pair, Exception ex)
 {
     if (Configuration.NotifyRecordReadObject != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Configuration.NotifyRecordReadObject.RecordLoadError(target, pair.Item1, pair.Item2, ex), false));
     }
     else if (Reader != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseRecordLoadError(target, pair.Item1, pair.Item2, ex), false));
     }
     return(true);
 }
Example #11
0
 private bool RaiseAfterRecordWrite(object target, long index, string state)
 {
     if (Configuration.NotifyRecordWriteObject != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Configuration.NotifyRecordWriteObject.AfterRecordWrite(target, index, state), true));
     }
     else if (Writer != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Writer.RaiseAfterRecordWrite(target, index, state), true));
     }
     return(true);
 }
Example #12
0
 private bool RaiseBeginLoad(object state)
 {
     if (Configuration.NotifyRecordReadObject != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Configuration.NotifyRecordReadObject.BeginLoad(state), true));
     }
     else if (Reader != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseBeginLoad(state), true));
     }
     return(true);
 }
 private bool RaiseReportEmptyLine(object target, long index)
 {
     if (_emptyLineReportableRecord != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => _emptyLineReportableRecord.EmptyLineFound(index), true));
     }
     else if (Reader != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseReportEmptyLine(index), true));
     }
     return(true);
 }
        private KeyValuePair <string, string>?RaiseCustomKVPReader(string recText)
        {
            KeyValuePair <string, string>?kvp = null;

            if (_customKVPRecord != null)
            {
                kvp = ChoFuncEx.RunWithIgnoreError(() => _customKVPRecord.ToKVP(recText));
            }
            else if (Reader != null)
            {
                kvp = ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseToKVP(recText));
            }
            return(kvp);
        }
        private bool RaiseBeforeRecordFieldWrite(object target, int index, string propName, ref object value)
        {
            if (_callbackRecord == null)
            {
                return(true);
            }
            object state    = value;
            bool   retValue = ChoFuncEx.RunWithIgnoreError(() => _callbackRecord.BeforeRecordFieldWrite(target, index, propName, ref state), true);

            if (retValue)
            {
                value = state;
            }

            return(retValue);
        }
        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);
        }
Example #17
0
 private bool RaiseAfterRecordFieldWrite(object target, long index, string propName, object value)
 {
     if (Writer != null && Writer.HasAfterRecordFieldWriteSubscribed)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Writer.RaiseAfterRecordFieldWrite(target, index, propName, value), true));
     }
     else if (target is IChoNotifyRecordFieldWrite)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => ((IChoNotifyRecordFieldWrite)target).AfterRecordFieldWrite(target, index, propName, value), true));
     }
     else if (_callbackRecordFieldWrite != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => _callbackRecordFieldWrite.AfterRecordFieldWrite(target, index, propName, value), true));
     }
     return(true);
 }
Example #18
0
        internal bool BeforeRecordFieldLoad(int index, string propName, ref object value)
        {
            if (_record == null)
            {
                return(true);
            }
            object state    = value;
            bool   retValue = ChoFuncEx.RunWithIgnoreError(() => _record.BeforeRecordFieldLoad(index, propName, ref state), true);

            if (retValue)
            {
                value = state;
            }

            return(retValue);
        }
Example #19
0
        private bool RaiseBeforeRecordWrite(object target, long index, ref string state)
        {
            if (Configuration.NotifyRecordWriteObject == null)
            {
                return(true);
            }
            object inState  = state;
            bool   retValue = ChoFuncEx.RunWithIgnoreError(() => Configuration.NotifyRecordWriteObject.BeforeRecordWrite(target, index, ref inState), true);

            if (retValue)
            {
                state = inState == null ? null : inState.ToString();
            }

            return(retValue);
        }
        private bool RaiseAfterRecordLoad(object target, Tuple <long, string> pair, ref bool skip)
        {
            bool ret = true;
            bool sp  = false;

            if (_callbackRecord != null)
            {
                ret = ChoFuncEx.RunWithIgnoreError(() => _callbackRecord.AfterRecordLoad(target, pair.Item1, pair.Item2, ref sp), true);
            }
            else if (Reader != null)
            {
                ret = ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseAfterRecordLoad(target, pair.Item1, pair.Item2, ref sp), true);
            }
            skip = sp;
            return(ret);
        }
Example #21
0
        private bool RaiseFileHeaderWrite(ref string headerText)
        {
            string ht       = headerText;
            bool   retValue = true;

            if (_callbackRecord != null)
            {
                retValue = ChoFuncEx.RunWithIgnoreError(() => _callbackRecord.FileHeaderWrite(ref ht), false);
            }
            else if (Writer != null)
            {
                retValue = ChoFuncEx.RunWithIgnoreError(() => Writer.RaiseFileHeaderWrite(ref ht), false);
            }
            headerText = ht;
            return(!retValue);
        }
        private bool RaiseBeforeRecordFieldLoad(object target, int index, string propName, ref object value)
        {
            if (Configuration.NotifyRecordReadObject == null)
            {
                return(true);
            }
            object state    = value;
            bool   retValue = ChoFuncEx.RunWithIgnoreError(() => Configuration.NotifyRecordReadObject.BeforeRecordFieldLoad(target, index, propName, ref state), true);

            if (retValue)
            {
                value = state;
            }

            return(retValue);
        }
Example #23
0
 private bool RaiseAfterRecordFieldLoad(object target, long index, string propName, object value)
 {
     if (Reader != null && Reader.HasAfterRecordFieldLoadSubscribed)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseAfterRecordFieldLoad(target, index, propName, value), true));
     }
     else if (target is IChoNotifyRecordFieldRead)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => ((IChoNotifyRecordFieldRead)target).AfterRecordFieldLoad(target, index, propName, value), true));
     }
     else if (CallbackRecordFieldRead != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => CallbackRecordFieldRead.AfterRecordFieldLoad(target, index, propName, value), true));
     }
     return(true);
 }
Example #24
0
        private bool RaiseBeforeRecordLoad(object target, ref Tuple <int, string> pair)
        {
            if (_callbackRecord == null)
            {
                return(true);
            }
            int    index    = pair.Item1;
            object state    = pair.Item2;
            bool   retValue = ChoFuncEx.RunWithIgnoreError(() => _callbackRecord.BeforeRecordLoad(target, index, ref state), true);

            if (retValue)
            {
                pair = new Tuple <int, string>(index, state as string);
            }

            return(retValue);
        }
Example #25
0
        internal bool BeforeRecordLoad(ref Tuple <int, string> pair)
        {
            if (_record == null)
            {
                return(true);
            }
            int    index    = pair.Item1;
            object state    = pair.Item2;
            bool   retValue = ChoFuncEx.RunWithIgnoreError(() => _record.BeforeRecordLoad(index, ref state), true);

            if (retValue)
            {
                pair = new Tuple <int, string>(index, state as string);
            }

            return(retValue);
        }
        private bool RaiseBeforeRecordLoad(object target, ref Tuple <int, string> pair)
        {
            if (Configuration.NotifyRecordReadObject == null)
            {
                return(true);
            }
            int    index    = pair.Item1;
            object state    = pair.Item2;
            bool   retValue = ChoFuncEx.RunWithIgnoreError(() => Configuration.NotifyRecordReadObject.BeforeRecordLoad(target, index, ref state), true);

            if (retValue)
            {
                pair = new Tuple <int, string>(index, state as string);
            }

            return(retValue);
        }
Example #27
0
        private bool RaiseBeforeRecordLoad(object target, ref Tuple <long, string> pair)
        {
            if (_callbackRecord != null)
            {
                long   index    = pair.Item1;
                object state    = pair.Item2;
                bool   retValue = ChoFuncEx.RunWithIgnoreError(() => _callbackRecord.BeforeRecordLoad(target, index, ref state), true);

                if (retValue)
                {
                    pair = new Tuple <long, string>(index, state as string);
                }

                return(retValue);
            }
            else if (target is IChoNotifyRecordRead)
            {
                long   index    = pair.Item1;
                object state    = pair.Item2;
                bool   retValue = ChoFuncEx.RunWithIgnoreError(() => ((IChoNotifyRecordRead)target).BeforeRecordLoad(target, index, ref state), true);

                if (retValue)
                {
                    pair = new Tuple <long, string>(index, state as string);
                }

                return(retValue);
            }
            else if (Reader != null)
            {
                long   index    = pair.Item1;
                object state    = pair.Item2;
                bool   retValue = ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseBeforeRecordLoad(target, index, ref state), true);

                if (retValue)
                {
                    pair = new Tuple <long, string>(index, state as string);
                }

                return(retValue);
            }
            return(true);
        }
Example #28
0
        private bool?RaiseDoWhile(Tuple <long, string> pair)
        {
            if (Configuration.NotifyFileReadObject != null)
            {
                long   index    = pair.Item1;
                object state    = pair.Item2;
                bool?  retValue = ChoFuncEx.RunWithIgnoreErrorNullableReturn <bool>(() => Configuration.NotifyFileReadObject.DoWhile(index, state));

                return(retValue);
            }
            else if (Reader != null)
            {
                long   index    = pair.Item1;
                object state    = pair.Item2;
                bool?  retValue = ChoFuncEx.RunWithIgnoreError <bool?>(() => Reader.RaiseDoWhile(index, state));

                return(retValue);
            }
            return(null);
        }
Example #29
0
        private bool?RaiseDoWhile(Tuple <long, string> pair)
        {
            if (_callbackRecord != null)
            {
                long   index    = pair.Item1;
                object state    = pair.Item2;
                bool?  retValue = ChoFuncEx.RunWithIgnoreErrorNullableReturn <bool>(() => _callbackRecord.DoWhile(index, state));

                return(retValue);
            }
            else if (Reader != null)
            {
                long   index    = pair.Item1;
                object state    = pair.Item2;
                bool?  retValue = ChoFuncEx.RunWithIgnoreError <bool?>(() => Reader.RaiseDoWhile(index, state));

                return(retValue);
            }
            return(null);
        }
Example #30
0
        private bool?RaiseDoWhile(Tuple <long, IDictionary <string, object> > pair)
        {
            if (Reader != null && Reader.HasDoWhileSubscribed)
            {
                long   index    = pair.Item1;
                object state    = pair.Item2;
                bool?  retValue = ChoFuncEx.RunWithIgnoreError <bool?>(() => Reader.RaiseDoWhile(index, state));

                return(retValue);
            }
            else if (_callbackFileRead != null)
            {
                long   index    = pair.Item1;
                object state    = pair.Item2;
                bool?  retValue = ChoFuncEx.RunWithIgnoreErrorNullableReturn <bool>(() => _callbackFileRead.DoWhile(index, state));

                return(retValue);
            }
            return(null);
        }