Skip to content

Instantly share code, notes, and snippets.

@chamons

chamons/foo.diff Secret

Created October 6, 2015 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chamons/a0ce25b67ddd87f2b05d to your computer and use it in GitHub Desktop.
Save chamons/a0ce25b67ddd87f2b05d to your computer and use it in GitHub Desktop.
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