示例#1
0
 async void AcceptDragDrop(IDataObject dataObject, bool controlKeyHeld)
 {
     if (UrlDragDropUtils.IsUriDataPresent(dataObject))
     {
         if (controlKeyHeld)
         {
             await logSourcesController.DeleteAllLogsAndPreprocessings();
         }
         var urls = UrlDragDropUtils.GetURLs(dataObject).ToArray();
         await preprocessingManager.Preprocess(
             urls.Select(url => preprocessingStepsFactory.CreateURLTypeDetectionStep(new PreprocessingStepParams(url))),
             urls.Length == 1?urls[0] : "Urls drag&drop"
             );
     }
     else if (dataObject.GetDataPresent(DataFormats.FileDrop, false))
     {
         if (controlKeyHeld)
         {
             await logSourcesController.DeleteAllLogsAndPreprocessings();
         }
         ((dataObject.GetData(DataFormats.FileDrop) as string[]) ?? new string[0]).Select(file =>
                                                                                          preprocessingManager.Preprocess(
                                                                                              Enumerable.Repeat(preprocessingStepsFactory.CreateFormatDetectionStep(new PreprocessingStepParams(file)), 1),
                                                                                              file
                                                                                              )
                                                                                          ).ToArray();
     }
 }
示例#2
0
		void DeleteExistingLogs()
		{
			model.DeleteAllLogsAndPreprocessings();
		}