public NSDragOperation TableViewValidateDrop(NSTableView aTableView, INSDraggingInfo aInfo, int aRow, NSTableViewDropOperation aOperation) { if (aTableView == ViewTable) { return(NSDragOperation.NSDragOperationMove); } return(NSDragOperation.NSDragOperationNone); }
public NSDragOperation ValidateDrop(INSDraggingInfo aInfo, object aDestination) { DraggableData dragData = new DraggableData(aInfo.DraggingPasteboard); EDragOperation op = iController.ValidateDrag(dragData, aDestination); return(DragDropManager.Convert(op)); }
public NSDragOperation ValidateDrop(NSTableView tableView, INSDraggingInfo info, nint row, NSTableViewDropOperation dropOperation) { if (info.DraggingPasteboard.GetDataForType(DataTypeName) != null) { return(NSDragOperation.Move); } return(NSDragOperation.None); }
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); }
public NSDragOperation DraggingEntered(INSDraggingInfo aInfo) { if (iDragDelegate != null) { return(iDragDelegate.DraggingEntered(aInfo)); } else { return(this.SendMessageSuper <NSDragOperation>(ThisClass, "draggingEntered:", aInfo)); } }
public bool PerformDragOperation(INSDraggingInfo aInfo) { if (iDragDelegate != null) { return(iDragDelegate.PerformDragOperation(aInfo)); } else { return(this.SendMessageSuper <bool>(ThisClass, "performDragOperation:", aInfo)); } }
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; }
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); }
public bool PrepareForDragOperation(INSDraggingInfo sender) { this.highlight = false; this.NeedsDisplay = true; NSPasteboard pboard = sender.DraggingPasteboard; return NSImage.CanInitWithPasteboard(pboard); }
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; }
public NSDragOperation TableViewValidateDropProposedRowProposedDropOperation(NSTableView aTableView, INSDraggingInfo info, int row, NSTableViewDropOperation operation) { throw new NotImplementedException (); }
public bool TableViewAcceptDropRowDropOperation(NSTableView aTableView, INSDraggingInfo info, int row, NSTableViewDropOperation operation) { return false; }
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; }
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; }
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)); } }
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); }
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); }
private bool prepareForDragOperation(INSDraggingInfo sender) { return true; }
private NSDragOperation draggingUpdated(INSDraggingInfo sender) { return NSDragOperation.NSDragOperationCopy; }
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(); }
public void DraggingExited(INSDraggingInfo sender) { this.highlight = false; this.NeedsDisplay = true; }
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); }