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 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);
 }
Esempio n. 3
0
 private bool RaiseBeginWrite(object state)
 {
     if (Writer != null && Writer.HasBeginWriteSubscribed)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Writer.RaiseBeginWrite(state), true));
     }
     else if (_callbackFileWrite != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => _callbackFileWrite.BeginWrite(state), true));
     }
     return(true);
 }
Esempio n. 4
0
 private bool RaiseBeginLoad(object state)
 {
     if (Reader != null && Reader.HasBeginLoadSubscribed)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseBeginLoad(state), true));
     }
     else if (_callbackFileRead != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => _callbackFileRead.BeginLoad(state), true));
     }
     return(true);
 }
Esempio n. 5
0
 private bool RaiseRecordLoadError(object target, Tuple <long, IDictionary <string, object> > pair, Exception ex)
 {
     if (Reader != null && Reader.HasRecordLoadErrorSubscribed)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseRecordLoadError(target, pair.Item1, pair.Item2, ex), false));
     }
     else if (_callbackRecordRead != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => _callbackRecordRead.RecordLoadError(target, pair.Item1, pair.Item2, ex), false));
     }
     return(true);
 }
Esempio n. 6
0
 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);
 }
Esempio n. 7
0
 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);
 }
Esempio n. 8
0
 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);
 }
Esempio n. 9
0
 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);
 }
Esempio n. 10
0
 private bool RaiseRecordLoadError(object target, Tuple <long, XElement> 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 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 RaiseAfterRecordLoad(object target, Tuple <long, string> pair)
 {
     if (Configuration.NotifyRecordReadObject != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Configuration.NotifyRecordReadObject.AfterRecordLoad(target, pair.Item1, pair.Item2), true));
     }
     else if (Reader != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Reader.RaiseAfterRecordLoad(target, pair.Item1, pair.Item2), true));
     }
     return(true);
 }
Esempio n. 13
0
 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);
 }
Esempio n. 14
0
 private bool RaiseAfterRecordFieldWrite(object target, long index, string propName, object value)
 {
     if (Configuration.NotifyRecordWriteObject != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Configuration.NotifyRecordFieldWriteObject.AfterRecordFieldWrite(target, index, propName, value), true));
     }
     else if (Writer != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Writer.RaiseAfterRecordFieldWrite(target, index, propName, value), true));
     }
     return(true);
 }
Esempio n. 15
0
 private bool RaiseRecordWriteError(object target, long index, string state, Exception ex)
 {
     if (Configuration.NotifyRecordWriteObject != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Configuration.NotifyRecordWriteObject.RecordWriteError(target, index, state, ex), false));
     }
     else if (Writer != null)
     {
         return(ChoFuncEx.RunWithIgnoreError(() => Writer.RaiseRecordWriteError(target, index, state, ex), false));
     }
     return(true);
 }
Esempio n. 16
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 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);
 }
 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);
 }
Esempio n. 19
0
        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);
        }
Esempio n. 20
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 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);
        }
Esempio n. 23
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);
 }
Esempio n. 24
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);
 }
Esempio n. 25
0
        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);
        }
Esempio n. 26
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);
        }
        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);
        }
Esempio n. 28
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);
        }
Esempio n. 29
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);
        }
        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);
        }