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);
}
上一篇下一篇

猜你喜欢

热点阅读