Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS] NSCollectionView.ValidateDrop should use 'ref', not 'out'. Fixes #60416 #2947

Merged
merged 2 commits into from Nov 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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