I am trying to get string from NSPasteboard in Xamarin.Mac, here is my code
NSPasteboard pasteboard = NSPasteboard.GeneralPasteboard;
string text = "";
Then what method of pasteboard do I use to store the string into text?
I am trying to get string from NSPasteboard in Xamarin.Mac, here is my code
NSPasteboard pasteboard = NSPasteboard.GeneralPasteboard;
string text = "";
Then what method of pasteboard do I use to store the string into text?
Copyright © 2021 Jogjafile Inc.
If you know you have string-based data on the pasteboard, you can use
GetStringForTypeusing the type ofNSStringType.Example:
Otherwise you can cycle through all the items on in the pasteboard using
PasteboardItemsto return an array ofNSPasteboardItemand review each item for the type that you are looking for.