Exemplo n.º 1
0
        private void Cleanup(IProgress <IEnumerable <ExceptionInfo> > exceptionProgress)
        {
            List <ExceptionInfo> exinfos = new List <ExceptionInfo>();

            try
            {
                FileSource?.Cleanup();
            }
            catch (Exception ex)
            {
                RunInfo.ExceptionInfos.Enqueue(new ExceptionInfo(ex));
            }
            try
            {
                Condition?.Cleanup();
            }
            catch (Exception ex)
            {
                RunInfo.ExceptionInfos.Enqueue(new ExceptionInfo(ex));
            }
            foreach (IFieldSource fieldSource in FieldSources)
            {
                try
                {
                    fieldSource?.Cleanup();
                }
                catch (Exception ex)
                {
                    RunInfo.ExceptionInfos.Enqueue(new ExceptionInfo(ex));
                }
            }
            foreach (IProcessor processor in TestedProcessors)
            {
                try
                {
                    processor?.Cleanup();
                }
                catch (Exception ex)
                {
                    RunInfo.ExceptionInfos.Enqueue(new ExceptionInfo(ex));
                }
            }
            foreach (IProcessor processor in MatchedProcessors)
            {
                try
                {
                    processor?.Cleanup();
                }
                catch (Exception ex)
                {
                    RunInfo.ExceptionInfos.Enqueue(new ExceptionInfo(ex));
                }
            }
            ReportFilesAndExceptions();
        }