radimitrov / CSharpShellApp

86 stars 18 forks source link

How Best to Write to Clipboard #90

Open jamesteller491 opened 3 years ago

jamesteller491 commented 3 years ago

On Windows, I use a reference to System.Windows.Forms to write text to the clipboard in my Console apps. Additionally, I add a [STAThread] attribute before the main program. Since C# Shell does not support Windows Forms (even though it's for a console app), what is the recommended way to write text to the clipboard using C# Shell? Thank you.

radimitrov commented 3 years ago

It will only work under a Xamarin platform, like Android and not Windows.Forms, but you can use Xamarin.Essentials.Clipboard.