public bool WriteObjects(NSPasteboardWriting [] objects) { var nsa_pasteboardReading = NSArray.FromNSObjects (objects); bool result = WriteObjects (nsa_pasteboardReading.Handle); nsa_pasteboardReading.Dispose (); return result; }
private NSDraggingItem CreateDraggingItem(string format, object data) { var pasteboardItem = new NSPasteboardItem(); NSData nsData; if (data is string s) { if (format == DataFormats.FileNames) { s = new Uri(s).AbsoluteUri; // Ensure file uris... } nsData = NSData.FromString(s); } else if (data is Stream strm) { nsData = NSData.FromStream(strm); } else if (data is byte[] bytes) { nsData = NSData.FromArray(bytes); } else { BinaryFormatter bf = new BinaryFormatter(); using (var ms = new MemoryStream()) { bf.Serialize(ms, data); ms.Position = 0; nsData = NSData.FromStream(ms); } } pasteboardItem.SetDataForType(nsData, DataFormatToUTI(format)); NSPasteboardWriting writing = new NSPasteboardWriting(pasteboardItem.Handle); return(new NSDraggingItem(writing)); }
CGRect SourceFrameOnScreenForShareItem(NSSharingService sharingService, NSPasteboardWriting item) { return(SourceFrameOnScreenForShareItem(sharingService, (INSPasteboardWriting)item)); }
NSImage TransitionImageForShareItem(NSSharingService sharingService, NSPasteboardWriting item, CGRect contentRect) { return(TransitionImageForShareItem(sharingService, (INSPasteboardWriting)item, contentRect)); }
public NSDraggingItem(NSPasteboardWriting pasteboardWriter) : this((INSPasteboardWriting)pasteboardWriter) { }
NSImage TransitionImageForShareItem(NSSharingService sharingService, NSPasteboardWriting item, CGRect contentRect) { return TransitionImageForShareItem (sharingService, (INSPasteboardWriting)item, contentRect); }
CGRect SourceFrameOnScreenForShareItem(NSSharingService sharingService, NSPasteboardWriting item) { return SourceFrameOnScreenForShareItem (sharingService, (INSPasteboardWriting)item); }