Exemplo n.º 1
0
 public NSDragOperation TableViewValidateDrop(NSTableView aTableView, INSDraggingInfo aInfo, int aRow, NSTableViewDropOperation aOperation)
 {
     if (aTableView == ViewTable)
     {
         return(NSDragOperation.NSDragOperationMove);
     }
     return(NSDragOperation.NSDragOperationNone);
 }
Exemplo n.º 2
0
        public NSDragOperation ValidateDrop(INSDraggingInfo aInfo, object aDestination)
        {
            DraggableData dragData = new DraggableData(aInfo.DraggingPasteboard);

            EDragOperation op = iController.ValidateDrag(dragData, aDestination);

            return(DragDropManager.Convert(op));
        }
Exemplo n.º 3
0
            public NSDragOperation ValidateDrop(NSTableView tableView, INSDraggingInfo info, nint row, NSTableViewDropOperation dropOperation)
            {
                if (info.DraggingPasteboard.GetDataForType(DataTypeName) != null)
                {
                    return(NSDragOperation.Move);
                }

                return(NSDragOperation.None);
            }
Exemplo n.º 4
0
 public bool TableViewAcceptDrop(NSTableView aTableView, INSDraggingInfo aInfo, int aRow, NSTableViewDropOperation aOperation)
 {
     if (aTableView == ViewTable)
     {
         UserLog.WriteLine("Moving " + iDraggedBookmarks.Count + " bookmark(s) to index " + aRow);
         iBookmarkManager.Move(aRow, iDraggedBookmarks);
         return(true);
     }
     return(false);
 }
Exemplo n.º 5
0
 public NSDragOperation DraggingEntered(INSDraggingInfo aInfo)
 {
     if (iDragDelegate != null)
     {
         return(iDragDelegate.DraggingEntered(aInfo));
     }
     else
     {
         return(this.SendMessageSuper <NSDragOperation>(ThisClass, "draggingEntered:", aInfo));
     }
 }
Exemplo n.º 6
0
 public bool PerformDragOperation(INSDraggingInfo aInfo)
 {
     if (iDragDelegate != null)
     {
         return(iDragDelegate.PerformDragOperation(aInfo));
     }
     else
     {
         return(this.SendMessageSuper <bool>(ThisClass, "performDragOperation:", aInfo));
     }
 }
Exemplo n.º 7
0
 public NSDragOperation DraggingEntered(INSDraggingInfo sender)
 {
     NSPasteboard pboard = sender.DraggingPasteboard;
     NSDragOperation operation = sender.DraggingSourceOperationMask;
     if (NSImage.CanInitWithPasteboard(pboard) && (operation & NSDragOperation.NSDragOperationCopy) == NSDragOperation.NSDragOperationCopy)
     {
         this.highlight = true;
         this.NeedsDisplay = true;
         return NSDragOperation.NSDragOperationCopy;
     }
     return NSDragOperation.NSDragOperationNone;
 }
Exemplo n.º 8
0
            public bool AcceptDrop(NSTableView tableView, INSDraggingInfo info, nint row, NSTableViewDropOperation dropOperation)
            {
                NSData     data    = info.DraggingPasteboard.GetDataForType(DataTypeName);
                NSIndexSet indexes = NSKeyedUnarchiver.UnarchiveObject(data) as NSIndexSet;

                if (indexes == null)
                {
                    return(false);
                }

                // Dropping at the bottom gives a row at the count, but we shift indexes first
                if (row >= this.viewModel.Targets.Count)
                {
                    row = this.viewModel.Targets.Count - 1;
                }

                this.viewModel.MoveTarget((int)indexes.FirstIndex, (int)row);
                return(true);
            }
Exemplo n.º 9
0
 public bool PrepareForDragOperation(INSDraggingInfo sender)
 {
     this.highlight = false;
     this.NeedsDisplay = true;
     NSPasteboard pboard = sender.DraggingPasteboard;
     return NSImage.CanInitWithPasteboard(pboard);
 }
Exemplo n.º 10
0
        public bool PerformDragOperation(INSDraggingInfo sender)
        {
            Id source = sender.DraggingSource;
            if (!this.Equals(source))
            {
                NSPasteboard pboard = sender.DraggingPasteboard;

                if (NSImage.CanInitWithPasteboard(pboard))
                {
                    this.Image.InitWithPasteboard(pboard);
                }

                NSURL fileURL = NSURL_AppKitAdditions.URLFromPasteboard(pboard);
                if (fileURL != null)
                {
                    this.Window.Title = fileURL.AbsoluteString;
                }
                else
                {
                    this.Window.Title = "No Name";
                }
            }
            return true;
        }
Exemplo n.º 11
0
 public NSDragOperation TableViewValidateDropProposedRowProposedDropOperation(NSTableView aTableView, INSDraggingInfo info, int row, NSTableViewDropOperation operation)
 {
     throw new NotImplementedException ();
 }
Exemplo n.º 12
0
 public bool TableViewAcceptDropRowDropOperation(NSTableView aTableView, INSDraggingInfo info, int row, NSTableViewDropOperation operation)
 {
     return false;
 }
Exemplo n.º 13
0
        public bool PerformDragOperation(INSDraggingInfo sender)
        {
            NSPoint point = this.ConvertPointFromView(sender.DraggingLocation, null);
            int index = this.IndexOfCircleAtPoint(point);

            if (index >= 0)
            {
                /* The current drag location is inside the bounds of a circle so we
                 * accept the drop and move on to concludeDragOperation:. */
                return true;
            }
            return false;
        }
Exemplo n.º 14
0
        public NSDragOperation DraggingEntered(INSDraggingInfo sender)
        {
            /* Since we have only registered for NSColorPboardType drags, this is
             * actually unneeded. If you were to register for any other drag types,
             * though, this code would be necessary. */
            if ((sender.DraggingSourceOperationMask & NSDragOperation.NSDragOperationGeneric) != 0)
            {
                NSPasteboard pasteboard = sender.DraggingPasteboard;
                if (pasteboard.Types.ContainsObject(NSPasteboard.NSColorPboardType))
                {
                    return NSDragOperation.NSDragOperationGeneric;
                }
            }

            return NSDragOperation.NSDragOperationNone;
        }
Exemplo n.º 15
0
        public void ConcludeDragOperation(INSDraggingInfo sender)
        {
            NSColor color = NSColor.ColorFromPasteboard(sender.DraggingPasteboard);
            NSPoint point = this.ConvertPointFromView(sender.DraggingLocation, null);
            int index = this.IndexOfCircleAtPoint(point);

            if (index >= 0)
            {
                Circle circle = this.circles.ObjectAtIndex((uint) index).CastTo<Circle>();
                circle.Color = color;
                this.SetNeedsDisplayInRect(this.BoundsForCircle(circle));
            }
        }
Exemplo n.º 16
0
        public bool AcceptDrop(INSDraggingInfo aInfo, int aIndex, object aDestination)
        {
            DraggableData dragData = new DraggableData(aInfo.DraggingPasteboard);

            return(iController.AcceptDrop(dragData, aIndex, aDestination));
        }
 public bool TableViewAcceptDropRowDropOperation(NSTableView aTableView, INSDraggingInfo info, int row, NSTableViewDropOperation operation)
 {
     return(false);
 }
Exemplo n.º 18
0
 public static void EnumerateDraggingItems(this INSDraggingInfo self, NSDraggingItemEnumerationOptions enumOpts, NSView view, NSArray classArray, NSDictionary searchOptions, NSDraggingEnumerator enumerator)
 {
     self.EnumerateDraggingItems(enumOpts, view, classArray.Handle, searchOptions, enumerator);
 }
Exemplo n.º 19
0
		private bool prepareForDragOperation(INSDraggingInfo sender)
		{
			return true;
		}
Exemplo n.º 20
0
		private NSDragOperation draggingUpdated(INSDraggingInfo sender)
		{
			return NSDragOperation.NSDragOperationCopy;
		}
Exemplo n.º 21
0
		public NSArray getFilenamesForDragOperation(INSDraggingInfo info)
		{
			//  ToDo: also support NSFileNamesPromisePboardType!
			NSPasteboard pboard = info.draggingPasteboard();
			return pboard.propertyListForType(NSFilenamesPboardType);
		}
 public NSDragOperation TableViewValidateDropProposedRowProposedDropOperation(NSTableView aTableView, INSDraggingInfo info, int row, NSTableViewDropOperation operation)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 23
0
 public void DraggingExited(INSDraggingInfo sender)
 {
     this.highlight = false;
     this.NeedsDisplay = true;
 }
Exemplo n.º 24
0
 public static void EnumerateDraggingItems(this INSDraggingInfo self, NSDraggingItemEnumerationOptions enumOpts, NSView view, INSPasteboardReading [] classArray, NSDictionary searchOptions, NSDraggingEnumerator enumerator)
 {
     using var nsa_classArray = NSArray.FromNSObjects(classArray);
     self.EnumerateDraggingItems(enumOpts, view, nsa_classArray.Handle, searchOptions, enumerator);
 }