Skip to content

Commit

Permalink
[macOS] NSCollectionView.ValidateDrop should use 'ref', not 'out'. Fi…
Browse files Browse the repository at this point in the history
…xes #60416 (#2947)
  • Loading branch information
Timothy Risi authored and spouliot committed Nov 10, 2017
1 parent 5993a81 commit 09b994a
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
44 changes: 44 additions & 0 deletions src/AppKit/NSCollectionViewDelegate.cs
@@ -0,0 +1,44 @@
#if !XAMCORE_4_0
using System;
using XamCore.Foundation;
using XamCore.ObjCRuntime;

namespace XamCore.AppKit
{
public partial class NSCollectionViewDelegate
{
[Obsolete ("Use 'ValidateDropOperation (NSCollectionView collectionView, NSDraggingInfo draggingInfo, ref NSIndexPath proposedDropIndexPath, ref NSCollectionViewDropOperation proposedDropOperation)' instead.")]
[Mac (10, 11)]
public virtual NSDragOperation ValidateDrop (NSCollectionView collectionView, NSDraggingInfo draggingInfo, out NSIndexPath proposedDropIndexPath, out NSCollectionViewDropOperation proposedDropOperation)
{
proposedDropIndexPath = null;
proposedDropOperation = NSCollectionViewDropOperation.On;
return ValidateDropOperation (collectionView, draggingInfo, ref proposedDropIndexPath, ref proposedDropOperation);
}
}

public partial class NSCollectionViewDelegateFlowLayout
{
[Obsolete ("Use 'ValidateDropOperation (NSCollectionView collectionView, NSDraggingInfo draggingInfo, ref NSIndexPath proposedDropIndexPath, ref NSCollectionViewDropOperation proposedDropOperation)' instead.")]
[Mac (10, 11)]
public virtual NSDragOperation ValidateDrop (NSCollectionView collectionView, NSDraggingInfo draggingInfo, out NSIndexPath proposedDropIndexPath, out NSCollectionViewDropOperation proposedDropOperation)
{
proposedDropIndexPath = null;
proposedDropOperation = NSCollectionViewDropOperation.On;
return ValidateDropOperation (collectionView, draggingInfo, ref proposedDropIndexPath, ref proposedDropOperation);
}
}

public static partial class NSCollectionViewDelegate_Extensions
{
[Obsolete ("Use 'ValidateDropOperation (NSCollectionView collectionView, NSDraggingInfo draggingInfo, ref NSIndexPath proposedDropIndexPath, ref NSCollectionViewDropOperation proposedDropOperation)' instead.")]
[Mac (10, 11)]
public static NSDragOperation ValidateDrop (this INSCollectionViewDelegate This, NSCollectionView collectionView, NSDraggingInfo draggingInfo, out NSIndexPath proposedDropIndexPath, out NSCollectionViewDropOperation proposedDropOperation)
{
proposedDropIndexPath = null;
proposedDropOperation = NSCollectionViewDropOperation.On;
return This.ValidateDropOperation (collectionView, draggingInfo, ref proposedDropIndexPath, ref proposedDropOperation);
}
}
}
#endif
8 changes: 7 additions & 1 deletion src/appkit.cs
Expand Up @@ -3008,9 +3008,15 @@ partial interface NSCollectionViewDelegate {
[Export ("collectionView:draggingImageForItemsAtIndexPaths:withEvent:offset:")]
NSImage GetDraggingImage (NSCollectionView collectionView, NSSet indexPaths, NSEvent theEvent, ref CGPoint dragImageOffset);

#if !XAMCORE_4_0
[Mac (10,11)]
[Export ("collectionView:validateDrop:proposedIndexPath:dropOperation:")]
NSDragOperation ValidateDrop (NSCollectionView collectionView, [Protocolize (4)] NSDraggingInfo draggingInfo, out NSIndexPath proposedDropIndexPath, out NSCollectionViewDropOperation proposedDropOperation);
NSDragOperation ValidateDropOperation (NSCollectionView collectionView, [Protocolize (4)] NSDraggingInfo draggingInfo, ref NSIndexPath proposedDropIndexPath, ref NSCollectionViewDropOperation proposedDropOperation);
#else
[Mac (10,11)]
[Export ("collectionView:validateDrop:proposedIndexPath:dropOperation:")]
NSDragOperation ValidateDrop (NSCollectionView collectionView, INSDraggingInfo draggingInfo, ref NSIndexPath proposedDropIndexPath, ref NSCollectionViewDropOperation proposedDropOperation);
#endif

[Mac (10,11)]
[Export ("collectionView:acceptDrop:indexPath:dropOperation:")]
Expand Down
1 change: 1 addition & 0 deletions src/frameworks.sources
Expand Up @@ -145,6 +145,7 @@ APPKIT_SOURCES = \
AppKit/NSSavePanel.cs \
AppKit/NSWorkspace.cs \
AppKit/NSCollectionView.cs \
AppKit/NSCollectionViewDelegate.cs \
AppKit/NSTextTableBlock.cs \
AppKit/NSMutableFontCollection.cs \
AppKit/NSCollectionViewLayout.cs \
Expand Down

0 comments on commit 09b994a

Please sign in to comment.