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."); } }
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."); } } }