Skip to content

Instantly share code, notes, and snippets.

@chamons

chamons/foo.diff Secret

Created Oct 6, 2015
Embed
What would you like to do?
diff --git a/NSOutlineViewAndTableView/NSOutlineViewAndTableViewExample/NSOutlineViewCode/NSOutlineViewExample.cs b/NSOutlineViewAndTableView/NSOutlineViewAndTableViewExample/NSOutlineViewCode/NSOutlineViewExample.cs
index b41e4b5..cd9012f 100644
--- a/NSOutlineViewAndTableView/NSOutlineViewAndTableViewExample/NSOutlineViewCode/NSOutlineViewExample.cs
+++ b/NSOutlineViewAndTableView/NSOutlineViewAndTableViewExample/NSOutlineViewCode/NSOutlineViewExample.cs
@@ -15,6 +15,8 @@ namespace NSOutlineViewAndTableViewExample
Frame = frame
};
+ outlineView.RegisterForDraggedTypes (new string[] { NSPasteboard.NSStringType });
+
// Every NSOutlineView must have at least one column or your Delegate will not be called.
NSTableColumn column = new NSTableColumn ("Values");
outlineView.AddColumn (column);
@@ -76,6 +78,22 @@ namespace NSOutlineViewAndTableViewExample
{
parentNode = Node.CreateExampleTree ();
}
+
+ public override bool AcceptDrop (NSOutlineView outlineView, NSDraggingInfo info, NSObject item, nint index)
+ {
+ return true;
+ }
+
+ public override NSDragOperation ValidateDrop (NSOutlineView outlineView, NSDraggingInfo info, NSObject item, nint index)
+ {
+ return NSDragOperation.Copy;
+ }
+
+ public override INSPasteboardWriting PasteboardWriterForItem (NSOutlineView outlineView, NSObject item)
+ {
+ NSString s = (NSString)"";
+ return s;
+ }
public override nint GetChildrenCount (NSOutlineView outlineView, NSObject item)
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment