xamarin mac app 文件拖拽
2016-10-13 本文已影响25人
UnityAsk
RegisterForDraggedTypes(new string[] { "NSFilenamesPboardType" });
public override void DraggingEnded(NSDraggingInfo sender)
{
isDragIn = false;
this.NeedsDisplay = true;
NSMutableArray array = (Foundation.NSMutableArray)sender.GetDraggingPasteboard().GetPropertyListForType("NSFilenamesPboardType");
string filePath = array.GetItem<NSString>(0);
Console.WriteLine(filePath);
}