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"
                    );
            }
        }
 async Task IPreprocessingStep.Execute(IPreprocessingStepCallback callback)
 {
     await ExecuteInternal(callback, p => { callback.YieldNextStep(preprocessingStepsFactory.CreateFormatDetectionStep(p)); });
 }
Exemple #3
0
 async Task IPreprocessingStep.Execute(IPreprocessingStepCallback callback)
 {
     callback.YieldNextStep(preprocessingStepsFactory.CreateFormatDetectionStep(await ExecuteInternal(callback, await getKeyFiles(callback))));
 }