Example #1
0
 protected void ValidateRootFolders(string sourceRootFolderPath, string targetRootFolderPath)
 {
     if (sourceRootFolderPath != null)
     {
         try
         {
             WellKnownFolderType wellKnownFolderType;
             List <string>       list;
             FolderMappingFlags  folderMappingFlags;
             FolderFilterParser.Parse(sourceRootFolderPath, out wellKnownFolderType, out list, out folderMappingFlags);
         }
         catch (FolderFilterPermanentException ex)
         {
             base.WriteError(new RootFolderInvalidPermanentException(CommonUtils.FullExceptionMessage(ex), ex), ErrorCategory.InvalidArgument, sourceRootFolderPath);
         }
     }
     if (targetRootFolderPath != null)
     {
         try
         {
             WellKnownFolderType wellKnownFolderType;
             List <string>       list;
             FolderMappingFlags  folderMappingFlags;
             FolderFilterParser.Parse(targetRootFolderPath, out wellKnownFolderType, out list, out folderMappingFlags);
         }
         catch (FolderFilterPermanentException ex2)
         {
             base.WriteError(new RootFolderInvalidPermanentException(CommonUtils.FullExceptionMessage(ex2), ex2), ErrorCategory.InvalidArgument, targetRootFolderPath);
         }
     }
 }
Example #2
0
 private void ValidateFolderFilter()
 {
     if (this.IncludeFolders != null)
     {
         try
         {
             foreach (string folderPath in this.IncludeFolders)
             {
                 WellKnownFolderType wellKnownFolderType;
                 List <string>       list;
                 FolderMappingFlags  folderMappingFlags;
                 FolderFilterParser.Parse(folderPath, out wellKnownFolderType, out list, out folderMappingFlags);
             }
         }
         catch (FolderFilterPermanentException ex)
         {
             base.WriteError(new FolderFilterInvalidPermanentException(CommonUtils.FullExceptionMessage(ex), ex), ErrorCategory.InvalidArgument, this.IncludeFolders);
         }
     }
     if (this.ExcludeFolders != null)
     {
         try
         {
             foreach (string folderPath2 in this.ExcludeFolders)
             {
                 WellKnownFolderType wellKnownFolderType;
                 List <string>       list;
                 FolderMappingFlags  folderMappingFlags;
                 FolderFilterParser.Parse(folderPath2, out wellKnownFolderType, out list, out folderMappingFlags);
             }
         }
         catch (FolderFilterPermanentException ex2)
         {
             base.WriteError(new FolderFilterInvalidPermanentException(CommonUtils.FullExceptionMessage(ex2), ex2), ErrorCategory.InvalidArgument, this.ExcludeFolders);
         }
     }
 }