Example #1
0
		void IDragDropHandler.AcceptDragDrop(object dataObject, bool controlKeyHeld)
		{
			var info = dataObject as NSDraggingInfo;
			if (info == null)
				return;
			var pboard = info.DraggingPasteboard;
			var types = pboard.Types;
			if (types.Contains(NSPasteboard.NSFilenamesType.ToString()))
			{
				if (controlKeyHeld)
					DeleteExistingLogs();
				var fnames = GetItemsForType(pboard, NSPasteboard.NSFilenamesType);
				foreach (var file in fnames)
					preprocessingManager.Preprocess(
						Enumerable.Repeat(preprocessingStepsFactory.CreateFormatDetectionStep(new PreprocessingStepParams(file)), 1),
						file
					);
			}
			else if (types.Contains(NSPasteboard.NSUrlType.ToString()))
			{
				if (controlKeyHeld)
					DeleteExistingLogs();
				var urls = GetItemsForType(pboard, NSPasteboard.NSUrlType);
				preprocessingManager.Preprocess(
					urls.Select(url => preprocessingStepsFactory.CreateURLTypeDetectionStep(new PreprocessingStepParams(url))),
					urls.Length == 1 ? urls[0] : "Urls drag&drop"
				);
			}
		}
Example #2
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();
     }
 }
Example #3
0
 public static Task OpenWorkspace(this ILogSourcesPreprocessingManager logSourcesPreprocessings,
                                  Preprocessing.IPreprocessingStepsFactory preprocessingStepsFactory, string workspaceUrl)
 {
     return(logSourcesPreprocessings.Preprocess(
                new[] { preprocessingStepsFactory.CreateOpenWorkspaceStep(new Preprocessing.PreprocessingStepParams(workspaceUrl)) },
                "opening workspace"
                ));
 }
Example #4
0
        void IPagePresenter.Apply()
        {
            string tmp = view.InputValue.Trim();

            if (tmp == "")
            {
                return;
            }
            view.InputValue = "";

            preprocessingManager.Preprocess(
                FileListUtils.ParseFileList(tmp).Select(arg => preprocessingStepsFactory.CreateLocationTypeDetectionStep(new PreprocessingStepParams(arg))),
                "Processing selected files"
                );
        }