Пример #1
0
 private IEnumerable<string> GetItems(Config config, ScanErrorSource source, string currentPath, Func<IEnumerable<string>> getter)
 {
     try {
     return getter();
       } catch (Exception e) {
     mScanErrorHandler.Handle(config, source, currentPath, e);
       }
       return Enumerable.Empty<string>();
 }
Пример #2
0
 public void Handle(Config config, ScanErrorSource source, string currentPath, Exception exception)
 {
     switch (config.ScanErrorMode) {
     case ScanErrorMode.Ask:
       AskHandlers(config, source, currentPath, exception);
       break;
     case ScanErrorMode.Throw:
       throw new ScanException(exception.Message, exception);
     default:
       return;
       }
 }
Пример #3
0
 public ScanErrorEventArgs(ScanErrorSource source, string path, Exception exception)
 {
     Source = source;
       Path = path;
       Exception = exception;
 }
Пример #4
0
 private static void AskHandlers(Config config, ScanErrorSource source, string currentPath, Exception exception)
 {
     config.Handlers.HandleError(new ScanErrorEventArgs(source, currentPath, exception));
 }