コード例 #1
0
 public async Task ImportAsync(string[] objectPaths)
 {
     try
     {
         BookImportingService.MasterDirectory = Specifications.MASTER_DIRECTORY;
         BookImportingService.ObjectPaths     = objectPaths;
         await TaskManager.Enqueue(BookImportingService.GetTaskSequence());
     }
     catch (NullReferenceException e)
     {
         s_logger.Error(e, "Failed to import.");
     }
     catch (Exception e)
     {
         s_logger.Error(e, "Failed to import.");
     }
 }
コード例 #2
0
 public async void Execute(IDataObject dataObject)
 {
     if (dataObject.GetData(DataFormats.FileDrop) is string[] objects && objects.Length > 0)
     {
         try
         {
             BookImportingService.MasterDirectory = Specifications.MASTER_DIRECTORY;
             BookImportingService.ObjectPaths     = objects;
             await TaskManager.Enqueue(BookImportingService.GetTaskSequence());
         }
         catch (NullReferenceException e)
         {
             s_logger.Error(e, "Failed to import.");
         }
         catch (Exception e)
         {
             s_logger.Error(e, "Failed to import.");
         }
     }
 }