Example #1
0
        private void Form_DragDrop(object sender, DragEventArgs e)
        {
            var files = ((string[])e.Data.GetData(DataFormats.FileDrop, false));

            using (Context.Activate().Scoped()) {
                FilesDropped?.Invoke(files);
            }
        }
Example #2
0
 private void RaiseFilesDropped(IEnumerable <string> files)
 {
     using (Context.Activate().Scoped()) {
         Application.WindowUnderMouse = this;
         FilesDropped?.Invoke(files);
         Input.DroppedFiles.AddRange(files);
     }
 }
Example #3
0
        private void Form_DragDrop(object sender, DragEventArgs e)
        {
            var files = ((string[])e.Data.GetData(DataFormats.FileDrop, false));

            using (Context.Activate().Scoped()) {
                Application.WindowUnderMouse = this;
                FilesDropped?.Invoke(files);
                Input.DroppedFiles.AddRange(files);
            }
        }
Example #4
0
 private void OnFilesDropped(IEnumerable <string> files)
 {
     FilesDropped?.Invoke(files);
     foreach (var filesDropHandler in filesDropHandlers)
     {
         if (filesDropHandler.TryToHandle(files))
         {
             break;
         }
     }
 }
Example #5
0
 public override bool PerformDragOperation(NSDraggingInfo sender)
 {
     if (base.PrepareForDragOperation(sender))
     {
         var nsFiles = ((NSArray)sender.DraggingPasteboard.GetPropertyListForType(NSPasteboard.NSFilenamesType));
         var files   = new List <string>();
         for (uint i = 0; i < nsFiles.Count; i++)
         {
             files.Add((nsFiles.GetItem <NSString>(i).ToString()));
         }
         FilesDropped?.Invoke(files);
         return(true);
     }
     return(false);
 }
Example #6
0
 private void SetDropHandler(IWindow window)
 {
     window.AllowDropFiles = true;
     window.FilesDropped  += files => FilesDropped?.Invoke(files);
 }
Example #7
0
 private void RaiseFilesDropped(IEnumerable <string> files)
 {
     using (Context.Activate().Scoped()) {
         FilesDropped?.Invoke(files);
     }
 }
Example #8
0
 /// <summary>
 /// Raises the <see cref="FilesDropped"/> event.
 /// </summary>
 protected virtual void OnFilesDropped(string[] fileNames)
 {
     FilesDropped?.Invoke(this, fileNames);
 }