예제 #1
0
        /// <summary>
        /// </summary>
        /// <returns></returns>
        public async Task <bool> SaveAsync()
        {
            try
            {
                await UnitOfWork.CommitAsync();

                return(true);
            }
            catch (Exception ex)
            {
                ExceptionReporter.Report(ex, Logger);
                return(false);
            }
        }
예제 #2
0
        private void ScanMember(ITypeDefinitionMember item)
        {
            if (!item.IsVisibleOutsideAssembly())
            {
                return;
            }

            var info = ScanPlatformNotSupported(item);

            _reporter.Report(info, item);
        }
 private static AssemblyCatalog CreateAssemblyCatalog(string file, IExceptionReporter reporter)
 {
     try
     {
         return(new AssemblyCatalog(file));
     }
     catch (Exception ex)
     {
         if (reporter != null)
         {
             reporter.Report(ex);
         }
         return(null);
     }
 }
        public T[] Compose <T>(IExceptionReporter reporter)
        {
            try
            {
                return(container.GetExportedValues <T>().ToArray());
            }
            catch (Exception ex)
            {
                if (reporter != null)
                {
                    reporter.Report(ex);
                    return(new T[0]);
                }

                throw;
            }
        }
        private IEnumerable <AssemblyCatalog> GetAssemblies(IExceptionReporter reporter)
        {
            IEnumerable <AssemblyCatalog> assemblyCatalogs = RetrieveFileList()
                                                             .Select(f => CreateAssemblyCatalog(f, reporter))
                                                             .Where(ac => ac != null);

            foreach (AssemblyCatalog assemblyCatalog in assemblyCatalogs)
            {
                try
                {
                    bool dummy = assemblyCatalog.Parts.Any();
                }
                catch (Exception ex)
                {
                    if (reporter != null)
                    {
                        reporter.Report(ex);
                    }
                    continue;
                }

                yield return(assemblyCatalog);
            }
        }